示例#1
0
        static void FindMore()
        {
            if (over)
            {
                return;
            }
            loading = true;
            index  += 15;
            part++;
            for (int ss = 0; ss < sp.Data.Count; ss++)
            {
                (sp.Data[ss] as IDisposable).Dispose();
            }
            sp.Data.Clear();
            ReSizeItemMod(2);
            over = false;
            string url = "http://node.video.qq.com/x/cgi/msearch?contextValue=last_end=%3D" +
                         index.ToString() + "%26areaId%3D101&keyWord=";

            url += Uri.EscapeUriString(content);
            url += "&contextType=2&callback=jsonp" + part.ToString();
            string str = address + content;

            str = Uri.EscapeUriString(str);
            NetClass.TaskGet(url, Analyze, str);
        }
示例#2
0
        public static void Find(string c)
        {
            if (loading)
            {
                return;
            }
            loading            = true;
            nav_index          = 13;
            nav.SelectedIndex  = -1;
            nav.Update         = true;
            FilterPanel.Visble = false;
            for (int ss = 0; ss < sp.Data.Count; ss++)
            {
                (sp.Data[ss] as IDisposable).Dispose();
            }
            sp.Data.Clear();
            ReSizeItemMod(2);
            content = c;
            over    = false;
            string url = "http://node.video.qq.com/x/cgi/msearch?contextValue=last_end=%3D" +
                         index.ToString() + "%26areaId%3D101&keyWord=";

            url += Uri.EscapeUriString(c);
            url += "&contextType=2&callback=jsonp" + part.ToString();
            string str = address + c;

            str = Uri.EscapeUriString(str);
            NetClass.TaskGet(url, Analyze, str);
        }
        public static void SetAddress(string url)
        {
            if (videolist != null)
            {
                int c = videolist.Data.Count;
                for (int i = 0; i < c; i++)
                {
                    (videolist.Data[i] as IDisposable).Dispose();
                }
                videolist.Data.Clear();
            }
            char[] c_buff = url.ToCharArray();
            int    t      = FindCharArray(ref c_buff, ref Key_m, 0);

            if (t > -1)     //mobile
            {
                type = "m"; //mobile
                site = url;
                NetClass.TaskGet(site, AnalyzeM, site);
                return;
            }
            else//desktop
            {
                t = FindCharArray(ref c_buff, ref Key_x, 0);
                if (t < 0)
                {
                    int c = FindCharArray(ref c_buff, ref Key_qq, 0);
                    c--;
                    type = new string(FindCharArrayA(ref c_buff, '/', '/', ref c));
                    if (type == "live")
                    {
                        site = url; goto label0;
                    }
                    int l = c_buff.Length - 1;
                    int i;
                    for (i = l; i > -1; i--)
                    {
                        if (c_buff[i] == '/')
                        {
                            break;
                        }
                    }
                    string tag = new string(FindCharArrayA(ref c_buff, '/', '.', ref i));
                    site = "http://v.qq.com/x/" + type + "/" + tag + ".html";
                }
                else
                {
                    site = url;
                    t   -= 2;
                    type = new string(FindCharArrayA(ref c_buff, '/', '/', ref t));
                }
            }
            label0 :;
            NetClass.TaskGet(site, Analyze, site);
        }
示例#4
0
        static void Find()
        {
            string url = "http://node.video.qq.com/x/cgi/msearch?contextValue=last_end=%3D" +
                         index.ToString() + "%26areaId%3D101&keyWord=";

            url += Uri.EscapeUriString(tb.Text);
            url += "&contextType=2&callback=jsonp" + part.ToString();
            string str = address + tb.Text;

            str = Uri.EscapeUriString(str);
            NetClass.TaskGet(url, Analyze, str);
        }
        static void Analyze(string data)
        {
            if (data.Length < 4096)
            {
                char[] c_buff = data.ToCharArray();
                c_buff = DeleteChar(ref c_buff, '\\');
                int o = FindCharArray(ref c_buff, ref Key_refresh, 0);
                if (o < 0)
                {
                    o = FindCharArray(ref c_buff, ref Key_split, 0);
                    if (o < 0)
                    {
                        return;
                    }
                    o    += 6;
                    site += new string(FindCharArrayA(ref c_buff, '\'', '\'', ref o));
                    NetClass.TaskGet(site, Analyze, site);
                    return;
                }
                o = FindCharArray(ref c_buff, ref Key_url, o);
                char[] tt;
                if (o < 0)
                {
                    o  = FindCharArray(ref c_buff, ref Key_href, 0);
                    tt = FindCharArrayA(ref c_buff, '\"', '\"', ref o);
                }
                else
                {
                    o = FindCharArray(ref c_buff, 'h', o);
                    int e = FindCharArray(ref c_buff, '\'', '\"', o);
                    e -= o;
                    tt = CopyCharArry(ref c_buff, o, e);
                }
                if (FindCharArray(ref tt, ref Key_http, 0) > -1)
                {
                    SetAddress(new string(tt));
                }
                else
                {
                    SetAddress("http:" + new string(tt));
                }
                return;
            }

            char[] c = data.ToCharArray();
            c = DeleteChar(ref c, '\\');
            //if (type == "cover")
            //{
            //    lep.Clear();
            //    ParseData.GetEp_infoA(ref c, lep);
            //    gb.Data.Clear();
            //    for(int i=0;i<lep.Count;i++)
            //    {
            //        gb.Data.Add(lep[i].Content);
            //    }
            //    gb.Update = true;
            //}
            int s = GetCoverInfo(ref c);

            if (s < 0)
            {
                s = 0;
            }
            ic          = ParseData.GetVideoInfo(ref c, s);
            title.Text  = ic.title;
            detail.Text = ic.detail;
            LoadPic(ic.src);
            ParseData.GetListInfo(ref c, videolist.Data, s);
            if (type == "cover")
            {
                ParseData.GetCoverList(ref c, videolist.Data, s, 50);
            }
            else
            {
                ParseData.GetPageList(ref c, videolist.Data);
            }
            s = FindCharArray(ref c, ref Key_player_figure, 0);
            if (s > 0)
            {
                s = FindCharArray(ref c, ref Key_src, s);
                char[] tt  = FindCharArrayA(ref c, '\"', '\"', ref s);
                var    src = "http:" + new string(tt);
            }
            videolist.Update      = true;
            ThreadManage.UpdateUI = true;
        }
示例#6
0
        static void Analyze(string data)
        {
            if (data.Length < 4096)
            {
                char[] c_buff = data.ToCharArray();
                c_buff = DeleteChar(ref c_buff, '\\');
                int o = FindCharArray(ref c_buff, ref Key_refresh, 0);
                if (o < 0)
                {
                    o = FindCharArray(ref c_buff, ref Key_split, 0);
                    if (o < 0)
                    {
                        return;
                    }
                    o    += 6;
                    site += new string(FindCharArrayA(ref c_buff, '\'', '\'', ref o));
                    NetClass.TaskGet(site, Analyze, site);
                    return;
                }
                o = FindCharArray(ref c_buff, ref Key_url, o);
                char[] tt;
                if (o < 0)
                {
                    o  = FindCharArray(ref c_buff, ref Key_href, 0);
                    tt = FindCharArrayA(ref c_buff, '\"', '\"', ref o);
                }
                else
                {
                    o = FindCharArray(ref c_buff, 'h', o);
                    int e = FindCharArray(ref c_buff, '\'', '\"', o);
                    e -= o;
                    tt = CopyCharArry(ref c_buff, o, e);
                }
                if (FindCharArray(ref tt, ref Key_http, 0) > -1)
                {
                    SetAdress(new string(tt));
                }
                else
                {
                    SetAdress("http:" + new string(tt));
                }
                return;
            }
            vp.data.Clear();
            sva.data.Clear();
            char[] c = data.ToCharArray();
            c = DeleteChar(ref c, '\\');
            if (type == "cover")
            {
                GetEp_infoA(ref c, vp.data);
            }
            int s = GetCoverInfo(ref c);

            if (s < 0)
            {
                s = 0;
            }
            vp.vi = GetVideoInfo(ref c, s);
            GetListInfo(ref c, sva.data, s);
            if (type == "cover")
            {
                GetCoverList(ref c, sva.data, s, vp.data.Count);
            }
            else
            {
                GetPageList(ref c, sva.data);
            }
            s = FindCharArray(ref c, ref Key_player_figure, 0);
            if (s > 0)
            {
                s = FindCharArray(ref c, ref Key_src, s);
                char[] tt = FindCharArrayA(ref c, '\"', '\"', ref s);
                vp.vi.src = "http:" + new string(tt);
            }
            cur_vid = vp.vi.vid;
            UpdatePage();
        }