Beispiel #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;
     }
 }
Beispiel #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;
     }
 }
Beispiel #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;
     }
 }
Beispiel #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;
     }
 }