Esempio n. 1
0
        public override void Download(object obj)
        {
            AsynObj o = (AsynObj)obj;



            string content = DlTool.GetHtml(o.Url, DlConfig.useProxy);

            if (content == "")
            {
                return;
            }
            string[] contents = null;
            try
            {
                contents = content.Split(new string[] { "<td align=\"center\">" }, StringSplitOptions.RemoveEmptyEntries);
                content  = contents[1];
            }
            catch
            {
                Console.WriteLine("split error");
                Download(o);
            }

            if (o.Path != null)
            {
                DlTool.SaveFile(content, Path.Combine(o.Path, DlTool.ReplaceUrl(o.Url) + ".htm"));
            }
            RarbgSgDl sgDl    = new RarbgSgDl();
            AsynObj   asynObj = new AsynObj();

            asynObj.Path    = o.Path;
            asynObj.Content = content;
            ThreadPool.QueueUserWorkItem(sgDl.Download, asynObj);
        }
Esempio n. 2
0
        void work(Object obj)
        {
            AsynObj asycObj = (AsynObj)obj;
            string  content = Sis001DlTool.GetHtml(asycObj.Url, true, "GB2312");

            DlTool.SaveFile(content, asycObj.Path);
        }
Esempio n. 3
0
        void work(Object obj)
        {
            AsynObj        asycObj       = (AsynObj)obj;
            HttpWebRequest downloadParam = (HttpWebRequest)WebRequest.Create(Config1.EMPTY_URL);

            downloadParam.Host = "www.akiba-online.com";
            string content = NewDlTool.GetHtml(asycObj.Url, true, downloadParam);

            DlTool.SaveFile(content, asycObj.Path);
            string gid           = gidRegex.Match(content).Value.Replace("var gid = ", "").Replace(";", "");
            string img           = imgRegex.Match(content).Value.Replace("var img = '", "").Replace("';", "");
            string link          = "https://www.javbus.com/ajax/uncledatoolsbyajax.php?gid=" + gid + "&lang=zh&img=" + img + "&uc=0&floor=900";
            string magnetContent = NewDlTool.GetHtml(link, true, downloadParam);

            DlTool.SaveFile(magnetContent, asycObj.Path + "_magenet");
        }
Esempio n. 4
0
        public override void Download(object obj)
        {
            AsynObj o = (AsynObj)obj;


            string content = Sis001DlTool.GetHtml(o.Url, true, "GB2312");

            if (content != "")
            {
                if (o.Path != null)
                {
                    DlTool.SaveFile(content, Path.Combine(o.Path, DlTool.ReplaceUrl(o.Url) + ".html"));
                }
                JavBusSgDl sgDl    = new JavBusSgDl();
                AsynObj    asynObj = new AsynObj();
                asynObj.Path    = o.Path;
                asynObj.Content = content;
                ThreadPool.QueueUserWorkItem(sgDl.Download, asynObj);
            }
        }
Esempio n. 5
0
        void work(Object obj)
        {
            AsynObj asycObj = (AsynObj)obj;
            string  content = DownloadTool.GetHtml(asycObj.Url, true, Common.CreateHttpWebRequest(asycObj.Url));

            DlTool.SaveFile(content, asycObj.Path);
            MatchCollection torrentMatch = torrentLinkRegex.Matches(content);

            if (torrentMatch.Count > 0)
            {
                string[] strs           = torrentMatch[torrentMatch.Count - 1].Value.Split('"');
                string   url            = "http://taohuabt.info/" + strs[0].Replace("&amp", "");
                string   torrentContent = DownloadTool.GetHtml(url, true, Common.CreateHttpWebRequest(url));
                DlTool.SaveFile(torrentContent, asycObj.Path + ".htm");
            }
            else
            {
                Console.WriteLine("没有匹配 " + asycObj.Url);
            }
        }
Esempio n. 6
0
        public override void Download(object obj)
        {
            AsynObj o = (AsynObj)obj;

            HttpWebRequest downloadParam = (HttpWebRequest)WebRequest.Create(Config1.EMPTY_URL);

            downloadParam.Host = "www.akiba-online.com";
            string content = NewDlTool.GetHtml(o.Url, true, downloadParam);

            if (content != "")
            {
                if (o.Path != null)
                {
                    DlTool.SaveFile(content, Path.Combine(o.Path, DlTool.ReplaceUrl(o.Url)) + ".htm");
                }
                AkibaOnlineSgDl sgDl    = new AkibaOnlineSgDl();
                AsynObj         asynObj = new AsynObj();
                asynObj.Path    = o.Path;
                asynObj.Content = content;
                ThreadPool.QueueUserWorkItem(sgDl.Download, asynObj);
            }
        }
Esempio n. 7
0
        public override void Download(object obj)
        {
            AsynObj o = (AsynObj)obj;


            string content = DownloadTool.GetHtml(o.Url, true, Common.CreateHttpWebRequest(o.Url));

            if (content != "")
            {
                //string[] contents = content.Split(new string[] { "<td align=\"center\">" }, StringSplitOptions.RemoveEmptyEntries);
                //content = contents[1];
                if (o.Path != null)
                {
                    DlTool.SaveFile(content, Path.Combine(o.Path, DlTool.ReplaceUrl(o.Url)) + ".htm");
                }
                ISinglePageDonwloader sgDl = new ThzSgDl();
                AsynObj asynObj            = new AsynObj();
                asynObj.Path    = o.Path;
                asynObj.Content = content;
                ThreadPool.QueueUserWorkItem(sgDl.Download, asynObj);
            }
        }
Esempio n. 8
0
        public override void Download(object obj)
        {
            AsynObj o = (AsynObj)obj;


            string content = Sis001DlTool.GetHtml(o.Url, true, "GB2312");

            if (content != "")
            {
                //string[] contents = content.Split(new string[] { "<td align=\"center\">" }, StringSplitOptions.RemoveEmptyEntries);
                //content = contents[1];
                if (o.Path != null)
                {
                    DlTool.SaveFile(content, Path.Combine(o.Path, DlTool.ReplaceUrl(o.Url) + ".htm"));
                }
                Sis001SgDl sgDl    = new Sis001SgDl();
                AsynObj    asynObj = new AsynObj();
                asynObj.Path    = o.Path;
                asynObj.Content = content;
                ThreadPool.QueueUserWorkItem(sgDl.Download, asynObj);
            }
        }
Esempio n. 9
0
        public void work(Object obj)
        {
            AsynObj asycObj = (AsynObj)obj;

            try
            {
                HttpWebRequest downloadParam = (HttpWebRequest)WebRequest.Create(Config1.EMPTY_URL);
                downloadParam.Host = "www.akiba-online.com";
                string          content = NewDlTool.GetHtml(asycObj.Url, true, downloadParam);
                string          name    = nameRegex.Match(content).Value.Replace("<title>", "").Replace("</title>", "");
                string          path    = Path.Combine(asycObj.Path, Config1.ValidePath(name) + ".htm");
                MatchCollection mc      = torrentRegex.Matches(content);
                ArrayList       list    = new ArrayList();
                foreach (Match match in mc)
                {
                    string torrentLink = "";
                    if (match.Value.Contains("torrent"))
                    {
                        torrentLink = "https://www.akiba-online.com/" + match.Value.Replace("<a href=\"", "").Replace("\" target=\"_blank\">", "");
                        list.Add(torrentLink);
                    }
                }

                path = Config1.InvalidPathFilter(path);
                foreach (string link in list)
                {
                    NewDlTool.downLoadFile(link, path + ".torrent", true, downloadParam);
                }
                DlTool.SaveFile(content, path);
            }catch (Exception e)
            {
                Console.WriteLine(e.Message + "  " + asycObj.Url);

                Config1.appendFile(asycObj.Url, "d:\\test\\failList.txt");
            }
        }