static void SetNav(int index) { if (loading) { return; } loading = true; if (sp != null) { if (sp.Data != null) { if (index < 6) { ReSizeItemMod(0); } else { ReSizeItemMod(1); } } } nav_index = index; if (index >= 0) { WebClass.TaskGet(nav_data[nav_index].href + GetFilter(), AnalyzeEx); } }
static async void GetComment(string sid) { string url = "http://coral.qq.com/article/" + cid + "/comment?otype=xml&commentid=" + sid; string cc = await WebClass.GetResults(url, "http://v.qq.com/txyp/coralComment_yp_1.0.htm"); AnalyComment(cc); }
static void back_click(object o, object e) { if (start > 0) { start--; nb.pagecount.Text = start.ToString(); WebClass.TaskGet(GetAdress(), AnalyzeEx); } }
public static async void LoadViewPageData(string url) { label1 :; char[] d = url.ToCharArray(); int c = FindCharArray(ref d, ref Key_vqq, 0); if (c > 0) { char[] t = new char[d.Length + 2]; for (int i = 0; i < 15; i++) { t[i] = d[i]; } t[15] = '/'; t[16] = 'x'; c = 15; for (int i = 17; i < t.Length; i++) { t[i] = d[c]; c++; } url = new string(t); } string cc = await WebClass.GetResults(url); if (cc.Length < 4096) { main_buff = cc.ToCharArray(); main_buff = DeleteChar(ref main_buff, '\\'); int s = FindCharArray(ref Key_refresh, 0); s = FindCharArray(ref Key_url, s); char[] tt; if (s < 0) { s = FindCharArray(ref Key_href, 0); tt = FindCharArrayA(ref main_buff, '\"', '\"', ref s); } else { s = FindCharArray(ref main_buff, 'h', s); int e = FindCharArray(ref main_buff, '\'', '\"', s); e -= s; tt = CopyCharArry(s, e); } if (FindCharArray(ref tt, ref Key_http, 0) > -1) { url = new string(tt); } else { url = "http:" + new string(tt); } goto label1; } ViewAnalyzeM(cc); }
static void SetNav(int index) { nav_index = index; filter = ""; start = 0; if (index >= 0) { WebClass.TaskGet(GetAdress(), AnalyzeEx); } }
static void GetHotComment(string sid) { if (loadH) { return; } loadH = true; string url = "https://coral.qq.com/article/" + cid + "/hotcomment?reqnum=20&commentid=" + sid; WebClass.TaskGet(url, AnalyHotComment, "http://v.qq.com/txyp/coralComment_yp_1.0.htm"); }
static void GetComment(string sid) { if (loadC) { return; } loadC = true; string url = "http://coral.qq.com/article/" + cid + "/comment?otype=xml&reqnum=20&commentid=" + sid; WebClass.TaskGet(url, AnalyComment, "http://v.qq.com/txyp/coralComment_yp_1.0.htm"); }
static void GetUpComment(string sid) { if (loadU) { return; } loadU = true; string url = "https://video.coral.qq.com/filmreviewr/c/upcomment/" + pid + "reqnum=10"; if (sid != null) { url += "&commentid=" + sid; } WebClass.TaskGet(url, AnalyUpComment, "http://v.qq.com/txyp/coralComment_yp_1.0.htm"); }
static void LoadComment(string vid) { if (vid == null) { return; } char[] c = site.ToCharArray(); int t = FallFindCharArray(ref c, '/', c.Length - 1); t--; pid = new string(FindCharArrayA(ref c, '/', '.', ref t)) + "?"; loadC = false; string cc = "http://ncgi.video.qq.com/fcgi-bin/video_comment_id?otype=json&op=3&vid=" + vid; WebClass.TaskGet(cc, TaskCid, "http://v.qq.com/x/cover/k8m3u2xb0nk9eee/t0327opjakl.html"); }
public static async void LoadComment(string vid) { Com_load = true; Com_over = false; string cc = "http://ncgi.video.qq.com/fcgi-bin/video_comment_id?otype=json&op=3&vid=" + vid; cid = await WebClass.GetResults(cc, "http://v.qq.com/x/cover/k8m3u2xb0nk9eee/t0327opjakl.html"); //Debug.WriteLine(cur_cid); char[] temp = cid.ToCharArray(); int s = FindCharArray(ref temp, ref Key_comment_id, 0); char[] t = FindCharArrayA(ref temp, '\"', '\"', ref s); cid = new string(t); GetComment("0"); }
static async void GetVideoFregment(string vid, string fn, SharpItem vi, Action <int> callback) { string str = "platform=11&otype=xml&vids=" + vid + "&format=" + vi.fid + "&filename=" + fn + vi.pid; int c = 2; l :; string cc = str + c.ToString() + ".mp4"; cc = await WebClass.Post("http://vv.video.qq.com/getkey", cc, "http://imgcache.qq.com/tencentvideo_v1/playerv3/TencentPlayer.swf?max_age=86400&v=20160819"); char[] tc = cc.ToCharArray(); //Debug.WriteLine(new string(DeleteChar(ref tc, '/'))); if (FindCharArray(ref tc, ref Key_key, 0) > 0) { c++; goto l; } c--; callback(c); }
static async void GetVideoInfo(string p, string vid, Action <VideoInfoA> callback) { string s = await WebClass.Post("http://vv.video.qq.com/getinfo", p, "http://imgcache.qq.com/tencentvideo_v1/playerv3/TencentPlayer.swf?max_age=86400&v=20161114"); char[] c = s.ToCharArray(); c = DeleteChar(ref c, '\\'); VideoInfoA vi = new VideoInfoA(); vi.vid = vid; vi.http = GetHttp(ref c); GetVI(ref c, ref vi); if (vi.fregment > 0) { string[] md5 = new string[vi.fregment]; GetCmd5(ref c, ref md5); vi.cmd5 = md5; } callback(vi); }
static void Tool_KeyDown(object o, KeyRoutedEventArgs e) { if (nb.pagecount.Text.Length >= 3) { e.Handled = true; return; } if (e.Key == VirtualKey.Enter) { start = Convert.ToInt32(nb.pagecount.Text); WebClass.TaskGet(GetAdress(), AnalyzeEx); return; } int c = (int)e.Key; if (c < 48 || c > 57) { e.Handled = true; } }
static void SetVideoInfo(VideoInfoA via) { VIA = via; VideoInfo[] vi = via.vi; char[] temp = vi[0].sharp.ToCharArray(); int s = CharToInt(ref temp); int c = 0; for (int i = 1; i < vi.Length; i++) { temp = vi[i].sharp.ToCharArray(); int t = CharToInt(ref temp); if (t > s) { s = t; c = i; } } View_VI.down_index = c; WebClass.GetVideoKey(via.vid, via.vi[c], (v, vk) => { VIA.vi[View_VI.down_index].vkey = vk; }, 1); WebClass.GetVideoFregment(via.vid, via.vi[c], GetFregment); }
static async void GetVideoKey(string vid, string fn, SharpItem vi, Action <string, int> callback, int part) { string str = "platform=11&otype=xml&vids=" + vid + "&format=" + vi.fid + "&filename=" + fn + vi.pid; str += part.ToString() + ".mp4"; str = await WebClass.Post("http://vv.video.qq.com/getkey", str, "http://imgcache.qq.com/tencentvideo_v1/playerv3/TencentPlayer.swf?max_age=86400&v=20161114"); char[] tc = str.ToCharArray(); int ccc = 0; tc = FindCharArrayA(ref tc, ref Key_key, ref Key_less, ref ccc); if (tc != null) { str = new string(tc); callback(str, part); } else { callback(null, part); } }
public async Task <string> GetPartVkey(int part) { SharpItem vi = via.vi[sharpindex]; string str = "platform=11&otype=xml&vids=" + vid + "&format=" + vi.fid + "&filename=" + via.fn + vi.pid; str += part.ToString() + ".mp4"; str = await WebClass.Post("http://vv.video.qq.com/getkey", str, "http://imgcache.qq.com/tencentvideo_v1/playerv3/TencentPlayer.swf?max_age=86400&v=20161114"); //Debug.WriteLine(str); char[] tc = str.ToCharArray(); int ccc = 0; tc = FindCharArrayA(ref tc, ref Key_key, ref Key_less, ref ccc); if (tc != null) { return(new string(tc)); } else { return(null); } }
public async void UpdateImag() { if (updating) { return; } updating = true; imgsteam = await WebClass.Get(src); if (imgsteam == null) { updating = false; return; } bs = UIImage.CreateWicBitmap(imgsteam); Img = UIImage.CreateD2DBitmap(bs.Converter); updating = false; if (Parent != null) { Parent.Update = true; ThreadManage.UpdateUI = true; } }
static void CreateLinkFile(string vid) { Main.Notify("正在解析地址,请等待几秒", Colors.Green, Colors.White); WebClass.GetVideoInfo(vid, SetVideoInfo); }
static void forward_click(object o, object e) { start++; nb.pagecount.Text = start.ToString(); WebClass.TaskGet(GetAdress(), AnalyzeEx); }
public static void Create(Canvas p, Thickness m) { if (sv != null) { sv.Show(); ReSize(m); return; } task1 = load1 = false; WebClass.TaskGet("http://m.v.qq.com/index.html", (o) => { data1 = o; if (task1) { ParseData.AnalyzeData(o.ToCharArray(), ref sv.area); sv.Refresh(); } else { load1 = true; } }); margin = m; sv = new Scroll_ex(); #if desktop sv.maxcolumn = 5; #else sv.maxcolumn = 4; sv.Lock = MainEx.LockPivot; sv.UnLock = MainEx.UnLockPivot; #endif sv.UsingCustomTitle = true; sv.ForceUpdateOnce = true; sv.area = new Area_m[nav_all.Length]; sv.ItemClick = (o) => { if (o != null) { VideoPage.SetAdress(o as string); PageManageEx.CreateNewPage(PageTag.videopage); } }; sv.PageClick = (o) => { PageAddress t = (PageAddress)o; if (t != PageAddress.None) { PartialNav.LoadPage(t); PageManageEx.CreateNewPage(PageTag.partial); } }; for (int i = 0; i < nav_all.Length; i++) { int c = nav_all[i].count; sv.area[i].page = nav_all[i].page; sv.area[i].title = nav_all[i].title; sv.area[i].count = c; sv.area[i].data = new ItemData_m[c]; } sv.ReSize(m); sv.SetParent(p); task1 = true; if (load1) { ParseData.AnalyzeData(data1.ToCharArray(), ref sv.area); sv.Refresh(); load1 = false; } }
static void CreateNavBar() { if (nb.can != null) { nb.can.Visibility = Visibility.Visible; return; } nb = new NavBar(); fp = new Canvas(); #if phone fp.Background = Component.bk_brush; #endif Canvas can = new Canvas(); nb.can = can; parent.Children.Add(can); parent.Children.Add(fp); nb.order = new ListBoxH(); nb.order.Margin = new Thickness(0, 40, 0, 0); nb.order.GetListBox.Foreground = Component.filter_brush; ListBox lb = nb.order.GetListBox; lb.SelectionChanged += (o, e) => { order_index = nb.order.GetListBox.SelectedIndex; WebClass.TaskGet(GetAdress(), AnalyzeEx); }; lb.Items.Add(order_4[Component.language]); lb.Items.Add(order_5[Component.language]); lb.Items.Add(order_6[Component.language]); nb.button = new TextBlock[5]; TextBlock b; for (int i = 0; i < 5; i++) { b = new TextBlock(); nb.button[i] = b; b.Margin = new Thickness(but_dx[i], 8, 0, 0); b.Text = nav_content[i][Component.language]; b.Foreground = Component.nav_brush; b.PointerPressed += reh[i]; can.Children.Add(b); } nb.pagecount = new TextBox(); nb.pagecount.Margin = new Thickness(110, 0, 0, 0); nb.pagecount.Text = "0"; nb.pagecount.KeyDown += Tool_KeyDown; nb.nav = new ListBox(); nb.nav.Margin = new Thickness(0, 90, 0, 0); nb.nav.Visibility = Visibility.Collapsed; nb.nav.Background = Component.bk_brush; nb.nav.Foreground = Component.nav_brush; nb.pagecount.Foreground = Component.font_brush; nb.nav.SelectionChanged += (o, e) => { nb.filter_change = true; SetNav(nb.nav.SelectedIndex); nb.pagecount.Text = "0"; #if phone nb.nav.Visibility = Visibility.Collapsed; #endif }; can.Children.Add(nb.order); can.Children.Add(nb.pagecount); can.Children.Add(nb.nav); buff_fim = new FilterItemMod[8]; nb.filter_change = true; }
static async void LoadPic(string src) { UIImage.LoadSource(await WebClass.Get(src), pic); }
static void NavOver(WebView w, WebViewNavigationCompletedEventArgs e) { WebClass.SetCookie(); }