Exemplo n.º 1
0
 public List <Struct_BT_Search> Get_Search_360(string KeyWord, int PageIndex, int TimeOut = 10000)
 {
     try
     {
         List <Struct_BT_Search> List_BT_Search = new List <Struct_BT_Search>();
         WebClientFX             web            = new WebClientFX(TimeOut);
         web.Encoding = Encoding.UTF8;
         string HTML = string.Empty;
         HTML = web.DownloadString(string.Format(@"http://video.so.com/ugc?kw={0}&from=&du=100&fr=100&pb=100&st=101&pageno={1}", KeyWord, PageIndex)).Replace("\r", "").Replace("\n", "").Replace("\t", "").Replace(" ", "").Replace("&nbsp;", "").Replace("<em>", "").Replace("</em>", "").Replace("class=\"cpillyellow-pill\"", "");
         int _i = 0;
         while (HTML.Length <= 100 && _i <= 10)
         {
             Thread.Sleep(1000);
             HTML = web.DownloadString(string.Format(@"http://video.so.com/ugc?kw={0}&from=&du=100&fr=100&pb=100&st=101&pageno={1}", KeyWord, PageIndex)).Replace("\r", "").Replace("\n", "").Replace("\t", "").Replace(" ", "").Replace("&nbsp;", "").Replace("<em>", "").Replace("</em>", "").Replace("class=\"cpillyellow-pill\"", "");
             _i++;
         }
         Regex           regResult = new Regex("<spanclass=\"w-figure-lefthint\">(.+?)</span><spanclass=\"w-figure-righthint\">(.+?)</span></span></a><h4><aclass=\'w-figure-title\'href=\'(.+?)\'title=\"(.+?)\">");
         MatchCollection mcResult  = regResult.Matches(HTML);
         if (mcResult.Count > 0)
         {
             foreach (Match mc in mcResult)
             {
                 string           ToUrl       = mc.Groups[3].Value;
                 string           Name        = mc.Groups[4].Value;
                 string           UpTime      = mc.Groups[2].Value;
                 string           VideoLength = mc.Groups[1].Value;
                 Struct_BT_Search item        = new Struct_BT_Search()
                 {
                     ToUrl       = ToUrl,
                     Name        = Name,
                     UpTime      = UpTime,
                     VideoLength = VideoLength,
                     Source      = "vedio.so.com"
                 };
                 List_BT_Search.Add(item);
             }
             return(List_BT_Search);
         }
         else
         {
             throw new Exception("No Data");
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Exemplo n.º 2
0
 public List <Struct_BT_Search> Get_Search_BT_TianTang(string KeyWord, int PageIndex, int TimeOut = 10000)
 {
     try
     {
         List <Struct_BT_Search> List_BT_Search = new List <Struct_BT_Search>();
         WebClientFX             web            = new WebClientFX(TimeOut);
         web.Encoding = Encoding.UTF8;
         string HTML = web.DownloadString(string.Format(@"http://www.bttiantang.com/s.php?q={0}", KeyWord)).Replace("\r", "").Replace("\n", "").Replace("\t", "").Replace(" ", "").Replace("&nbsp;", "").Replace("<em>", "").Replace("</em>", "").Replace("class=\"cpillyellow-pill\"", "");
         Clipboard.SetText(HTML);
         Regex           regResult = new Regex("</span><ahref=\"/subject/(.+?)\"target=\"_blank\">");
         MatchCollection mcResult  = regResult.Matches(HTML);
         if (mcResult.Count > 0)
         {
             foreach (Match mc in mcResult)
             {
                 MessageBox.Show(mc.Groups[1].Value);
                 continue;
                 string           ToUrl       = mc.Groups[1].Value;
                 string           Name        = mc.Groups[2].Value;
                 string           UpTime      = mc.Groups[4].Value;
                 string           VideoLength = mc.Groups[5].Value;
                 Struct_BT_Search item        = new Struct_BT_Search()
                 {
                     ToUrl       = ToUrl,
                     Name        = Name.Replace("【失效链接】", "").Replace("【无效链接】", "").Replace("【处理中,请等待】", ""),
                     UpTime      = UpTime,
                     VideoLength = VideoLength,
                     Source      = "CI_LI_BA"
                 };
                 List_BT_Search.Add(item);
             }
             //检测所有磁链连通性
             //TestingHash();
             return(List_BT_Search);
         }
         else
         {
             throw new Exception("No Data");
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Exemplo n.º 3
0
 public List <Struct_BT_Search> Get_Search_BT_SOSO(string KeyWord, int PageIndex, int TimeOut = 10000)
 {
     try
     {
         List <Struct_BT_Search> List_BT_Search = new List <Struct_BT_Search>();
         WebClientFX             web            = new WebClientFX(TimeOut);
         web.Encoding = Encoding.UTF8;
         string          HTML      = FromUnicodeString(web.DownloadString(string.Format(@"http://api.xhub.cn/api.php?op=search_list&key={0}&page={1}", KeyWord, PageIndex)).Replace("{", "").Replace("}", "").Replace("\"", ""));
         Regex           regResult = new Regex("(.+?):title:(.+?),size:(.+?),day:(.+?),hits:(.+?)");
         MatchCollection mcResult  = regResult.Matches(HTML);
         if (mcResult.Count > 0)
         {
             foreach (Match mc in mcResult)
             {
                 string           ToUrl       = mc.Groups[1].Value;
                 string           Name        = mc.Groups[2].Value;
                 string           VideoLength = mc.Groups[3].Value;
                 string           UpTime      = mc.Groups[4].Value;
                 Struct_BT_Search item        = new Struct_BT_Search()
                 {
                     ToUrl       = ToUrl,
                     Name        = Name.Replace("【失效链接】", "").Replace("【无效链接】", "").Replace("【处理中,请等待】", ""),
                     UpTime      = UpTime,
                     VideoLength = VideoLength,
                     Source      = "BT_SOSO"
                 };
                 List_BT_Search.Add(item);
             }
             //检测所有磁链连通性
             //TestingHash();
             return(List_BT_Search);
         }
         else
         {
             throw new Exception("No Data");
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Exemplo n.º 4
0
 public List <Struct_BT_Search> Get_Search_CI_LI_BA(string KeyWord, int PageIndex, int TimeOut = 10000)
 {
     try
     {
         List <Struct_BT_Search> List_BT_Search = new List <Struct_BT_Search>();
         WebClientFX             web            = new WebClientFX(TimeOut);
         web.Encoding = Encoding.UTF8;
         string          HTML      = web.DownloadString(string.Format(@"http://www.cili8.org/s/{0}_rel_{1}.html", KeyWord, PageIndex)).Replace("\r", "").Replace("\n", "").Replace("\t", "").Replace(" ", "").Replace("&nbsp;", "").Replace("<em>", "").Replace("</em>", "").Replace("class=\"cpillyellow-pill\"", "");
         Regex           regResult = new Regex("<ahref=\"http://www.cili8.net/detail/(.+?).html\"target=\"_blank\">(.+?)</a></h3></div><divclass=\"item-list\">(.+?)</div><divclass=\"item-bar\"><spanclass=\"cpillfileType1\">视频</span><span>创建时间:<b>(.+?)</b></span><span>文件大小:<b>(.+?)</b></span>");
         MatchCollection mcResult  = regResult.Matches(HTML);
         if (mcResult.Count > 0)
         {
             foreach (Match mc in mcResult)
             {
                 string           ToUrl       = mc.Groups[1].Value;
                 string           Name        = mc.Groups[2].Value;
                 string           UpTime      = mc.Groups[4].Value;
                 string           VideoLength = mc.Groups[5].Value;
                 Struct_BT_Search item        = new Struct_BT_Search()
                 {
                     ToUrl       = ToUrl,
                     Name        = Name.Replace("【失效链接】", "").Replace("【无效链接】", "").Replace("【处理中,请等待】", ""),
                     UpTime      = UpTime,
                     VideoLength = VideoLength,
                     Source      = "CI_LI_BA"
                 };
                 List_BT_Search.Add(item);
             }
             //检测所有磁链连通性
             //TestingHash();
             return(List_BT_Search);
         }
         else
         {
             throw new Exception("No Data");
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Exemplo n.º 5
0
        public List <string> GetSrcURL(string http_url, int TimeOut = 10000)
        {
            try
            {
                List <string>           res            = new List <string>();
                List <Struct_BT_Search> List_BT_Search = new List <Struct_BT_Search>();
                WebClientFX             web            = new WebClientFX(TimeOut);
                web.Encoding = Encoding.Default;
                web.Headers.Add("Referer", "http://www.flvcd.com/parse.php");
                web.Headers.Add("Accept", "*/*");
                web.Headers.Add("Accept-Language", "zh-cn");
                web.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
                web.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; 125LA; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)");
                string          HTML      = web.DownloadString(@"http://www.flvcd.com/parse.php?kw=" + @http_url);
                Regex           regResult = new Regex("<a href=\"(.+?)\" target=\"_blank\" class=\"link\" onclick=");
                MatchCollection mcResult  = regResult.Matches(HTML);

                Regex           regName = new Regex("<input type=\"hidden\" name=\"name\" value=\"(.+?)\">");
                MatchCollection mcName  = regName.Matches(HTML);
                string          Name    = mcName.Count > 0 ? mcName[0].Groups[1].Value : "";

                if (mcResult.Count > 0)
                {
                    foreach (Match mc in mcResult)
                    {
                        res.Add(mc.Groups[1].Value);
                    }
                    return(res);
                }
                else
                {
                    throw new Exception("No Data");
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }