コード例 #1
0
ファイル: ParseData.cs プロジェクト: lilewa/tencent-video-UWP
        public static void VideoCover(ref char[] c_buff, List <ItemDataA> eic, List <ItemDataA> lic, int start, int ec)
        {
            int e = FindCharArray(ref c_buff, ref Key_listinfoE, start);

            if (e < 0)
            {
                e = c_buff.Length;
            }
            eic.Clear();
            lic.Clear();
            int s = start;

            s = FindCharArray(ref c_buff, ref Key_data, s);
            s = FindCharArray(ref c_buff, ref Key_vidB, s, e);
            int       index = ec;
            int       count = 0;
            ItemDataA ic    = new ItemDataA();

            while (s > 0)
            {
                ic.detail = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref s));
                s         = FindCharArray(ref c_buff, ref Key_titleA, s);
                s++;
                ic.title = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref s));
                s        = FindCharArray(ref c_buff, ref Key_preview, s);
                if (s < 0)
                {
                    break;
                }
                char[] t = FindCharArrayA(ref c_buff, '\"', '\"', ref s);
                if (FindCharArray(ref t, ref Key_http, 0) > -1)
                {
                    ic.src = new string(t);
                }
                else
                {
                    ic.src = "http:" + new string(t);
                }
                if (count < index)
                {
                    eic.Add(ic);
                }
                else
                {
                    lic.Add(ic);
                }
                s = FindCharArray(ref c_buff, ref Key_vidB, s, e);
                count++;
            }
        }
コード例 #2
0
        static void GetPageList(ref char[] c_buff, List <ItemDataA> lic)
        {
            int s = FindCharArray(ref c_buff, ref Key_mod_playlist, 0);

            if (s < 0)
            {
                return;
            }
            ItemDataA ic = new ItemDataA();

            s = FindCharArray(ref c_buff, ref Key_list_itemA, s);
            int e = FindCharArray(ref c_buff, ref Key_ul_e, s);
            int c;

            while (s > 0)
            {
                c = FindCharArray(ref c_buff, ref Key_href, s);
                char[] href = FindCharArrayA(ref c_buff, '\"', '\"', ref c);
                int    a    = FindCharArray(ref href, ref Key_vidA, 0);
                if (a > 0)
                {
                    ic.detail = new string(CopyCharArry(ref href, a, href.Length - a));
                }
                else
                {
                    goto label0;
                }
                ic.href = "http://v.qq.com" + new string(href);
                c       = FindCharArray(ref c_buff, ref Key_src, c);
                char[] t = FindCharArrayA(ref c_buff, '\"', '\"', ref c);
                if (FindCharArray(ref t, ref Key_http, 0) > -1)
                {
                    ic.src = new string(t);
                }
                else
                {
                    ic.src = "http:" + new string(t);
                }
                c        = FindCharArray(ref c_buff, ref Key_alt, c);
                ic.title = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref c));
                lic.Add(ic);
                label0 :;
                s = FindCharArray(ref c_buff, ref Key_list_itemA, c);
                if (s > e)
                {
                    break;
                }
            }
        }
コード例 #3
0
ファイル: ParseData.cs プロジェクト: lilewa/tencent-video-UWP
        public static int Search_ex(char[] buff, List <ItemDataA> lia)
        {
            ItemDataA im = new ItemDataA();
            int       s  = 0;
            string    detail;
            int       i;

            for (i = 0; i < 15; i++)
            {
                s = FindCharArray(ref buff, ref Key_idA, s);
                if (s < 0)
                {
                    break;
                }
                detail  = "";
                s       = FindCharArray(ref buff, ref Key_posterPic, s);
                im.src  = new string(FindCharArrayA(ref buff, '\"', '\"', ref s));
                detail += "播放量:" + new string(FindCharArrayA(ref buff, ':', ',', ref s));
                s       = FindCharArray(ref buff, ref Key_duration, s);
                detail += "\r\n时长:" + new string(FindCharArrayA(ref buff, ':', ',', ref s));
                s       = FindCharArray(ref buff, ref Key_titleA, s);
                s++;
                char[] t = FindCharArrayA(ref buff, '\"', '\"', ref s);
                im.title = GetString16A(ref t);
                s        = FindCharArray(ref buff, ref Key_videoCategory, s);
                s++;
                detail += "S\r\n分类:" + new string(FindCharArrayA(ref buff, '\"', '\"', ref s));
                s       = FindCharArray(ref buff, ':', s);
                t       = FindCharArrayA(ref buff, '\"', '\"', ref s);
                if (t != null)
                {
                    detail += "\r\n区域:" + GetString16A(ref t);
                }
                s       = FindCharArray(ref buff, ':', s);
                detail += "\r\n" + new string(FindCharArrayA(ref buff, '\"', '\"', ref s));
                s       = FindCharArray(ref buff, ref Key_webPlayUrl, s);
                s++;
                im.href = new string(FindCharArrayA(ref buff, '\"', '\"', ref s));
                s       = FindCharArray(ref buff, ref Key_publishDate, s);
                s++;
                detail   += "\r\n" + new string(FindCharArrayA(ref buff, '\"', '\"', ref s));
                im.detail = detail;
                lia.Add(im);
            }
            return(i);
        }
コード例 #4
0
        static void GetListInfo(ref char[] c_buff, List <ItemDataA> data, int s)
        {
            int t = FindCharArray(ref c_buff, ref Key_listinfo, s);

            if (t < 0)
            {
                return;
            }
            int e = FindCharArray(ref c_buff, ref Key_listinfoE, t);

            t = FindCharArray(ref c_buff, ref Key_data, t);
            t = FindCharArray(ref c_buff, ref Key_vidB, t, e);
            ItemDataA ei = new ItemDataA();

            while (t > 0)
            {
                ei.detail = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref t));
                t         = FindCharArray(ref c_buff, ref Key_duration, t);
                t++;
                ei.href = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref t));
                t       = FindCharArray(ref c_buff, ref Key_titleA, t);
                t++;
                ei.title = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref t));
                t        = FindCharArray(ref c_buff, ref Key_preview, t);
                char[] c = FindCharArrayA(ref c_buff, '\"', '\"', ref t);
                if (c[0] != 'h')
                {
                    ei.src = "http:" + new string(c);
                }
                else
                {
                    ei.src = new string(c);
                }
                t = FindCharArray(ref c_buff, ref Key_vidB, t, e);
                data.Add(ei);
            }
        }
コード例 #5
0
ファイル: ParseData.cs プロジェクト: lilewa/tencent-video-UWP
        public static ImageContext Des_PlayPage(char[] c_buff, List <EP_Info> lep, List <ItemDataA> lid)
        {
            c_buff = DeleteChar(ref c_buff, '\\');
            ImageContext ic = new ImageContext();
            int          s  = FindCharArray(ref c_buff, ref Key_mod_video_info, 0);

            if (s < 0)
            {
                return(ic);
            }
            int    e   = FindCharArray(ref c_buff, ref Key_section_e, s);
            int    t   = FindCharArray(ref c_buff, ref Key_video_tit, s);
            string str = "";

            if (t > 0)
            {
                ic.title = new string(FindCharArrayA(ref c_buff, '>', '<', ref t)) + "\r\n";
                s        = t;
            }
            t = FindCharArray(ref c_buff, ref Key_video_types, s);
            if (t > 0)
            {
                str += new string(FindCharArrayA(ref c_buff, '>', '<', ref t)) + "\r\n";
                s    = t;
            }
            for (int i = 0; i < 3; i++)
            {
                t = FindCharArray(ref c_buff, ref Key_intro_line, s);
                if (t > 0)
                {
                    str += new string(FindCharArrayA(ref c_buff, '>', '<', ref t)) + "\r\n";
                    s    = t;
                }
                else
                {
                    break;
                }
            }
            ic.detail = str;
            t         = FindCharArray(ref c_buff, ref Key_mod_sideslip_episodes, s);
            if (t > 0)
            {
                EP_Info ep = new EP_Info();
                e = FindCharArray(ref c_buff, ref Key_section_e, t);
                int c = 1;
                while (t > 0)
                {
                    t = FindCharArray(ref c_buff, ref Key_li, s, e);
                    if (t < 0)
                    {
                        break;
                    }
                    t      = FindCharArray(ref c_buff, ref Key_vidA, t);
                    ep.vid = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref t));
                    int le = FindCharArray(ref c_buff, ref Key_a_e, t);
                    t = FindCharArray(ref c_buff, ref Key_i, t, le);
                    if (t > 0)
                    {
                        ep.title = c.ToString() + new string(FindCharArrayA(ref c_buff, '>', '<', ref t));
                    }
                    else
                    {
                        ep.title = c.ToString();
                    }
                    c++;
                    s = le;
                    lep.Add(ep);
                }
            }
            t = FindCharArray(ref c_buff, ref Key_video, s);
            if (t > 0)
            {
                t      = FindCharArray(ref c_buff, ref Key_vidB, t);
                ic.vid = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref t));
                t      = FindCharArray(ref c_buff, ref Key_pic, t);
                t      = FindCharArray(ref c_buff, ':', t);
                ic.src = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref t));
                s      = t;
            }
            t = FindCharArray(ref c_buff, ref Key_clips, s);
            if (t > 0)
            {
                ItemDataA ida = new ItemDataA();
                e = FindCharArray(ref c_buff, ref Key_m_e, t);
                while (t > 0)
                {
                    t = FindCharArray(ref c_buff, ref Key_vidB, s, e);
                    if (t < 0)
                    {
                        break;
                    }
                    if (e - s < 200)
                    {
                        break;
                    }
                    ida.detail = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref t));
                    t          = FindCharArray(ref c_buff, ref Key_titleA, t);
                    t++;
                    ida.title = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref t));
                    t         = FindCharArray(ref c_buff, ref Key_pic, t);
                    t         = FindCharArray(ref c_buff, ':', t);
                    ida.src   = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref t));
                    int le = FindCharArray(ref c_buff, '}', t);
                    s  = le;
                    le = FindCharArray(ref c_buff, ref Key_duration, t, s);
                    if (le > 0)
                    {
                        le++; ida.href = new string(FindCharArrayA(ref c_buff, '\"', '\"', ref le));
                    }
                    else
                    {
                        ida.href = null;
                    }
                    lid.Add(ida);
                }
            }
            return(ic);
        }