Esempio n. 1
0
        void work(Object obj)
        {
            AsynObj asycObj = (AsynObj)obj;
            string  content = Sis001DlTool.GetHtml(asycObj.Url, true, "GB2312");

            DlTool.SaveFile(content, asycObj.Path);
        }
Esempio n. 2
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. 3
0
        private void work(object obj)
        {
            string          genreStr = "";
            MatchCollection genresMatches;
            AsynObj         o       = (AsynObj)obj;
            string          content = DlTool.GetHtml(o.Url, DlConfig.useProxy);

            o.SingleContent = content;
            string   dateString  = releaseDateRegex.Match(content).Value.Replace("\"releaseDate\">", "").Replace("</td></tr>", "");
            DateTime releaseDate = Convert.ToDateTime(dateString);
            string   url         = "https://rarbg.to/" + torrentRegex.Match(content).Value;
            Match    genres      = genresRegex.Match(content);
            string   path        = "";

            if (genres != null && genres.Value != "")
            {
                genresMatches = genresRegex1.Matches(genres.Value);
                foreach (Match m in genresMatches)
                {
                    genreStr += m.Value.Replace("search=", "").Replace("\"", "").ToLower().Replace("+", " ") + ",";
                }
            }
            if (check1(url.Substring(url.LastIndexOf('=') + 1).ToLower()))
            {
                path = Path.Combine(o.Path, genreStr + "$$" + url.Substring(url.LastIndexOf('=') + 1)).Replace("%22", "");
            }
            else if (!check2(url.Substring(url.LastIndexOf('=') + 1).ToLower()))
            {
                path = Path.Combine(o.Path, "notok", genreStr + "$$" + url.Substring(url.LastIndexOf('=') + 1)).Replace("%22", "");
            }
            else if (releaseDate.CompareTo(new DateTime(2014, 8, 1)) < 0)
            {
                if (genres != null && genres.Value != "")
                {
                    int res = check(genreStr.Substring(0, genreStr.Length - 1).Replace("%22", ""));
                    if (res == 1)
                    {
                        path = Path.Combine(o.Path, genreStr + "$$" + url.Substring(url.LastIndexOf('=') + 1)).Replace("%22", "");
                    }
                    else if (res == -1)
                    {
                        path = Path.Combine(o.Path, "notok", genreStr + "$$" + url.Substring(url.LastIndexOf('=') + 1)).Replace("%22", "");
                    }
                    else
                    {
                        path = Path.Combine(o.Path, "unknown", genreStr + "$$" + url.Substring(url.LastIndexOf('=') + 1)).Replace("%22", "");
                    }
                }
                else
                {
                    path = Path.Combine(o.Path, "unknown", url.Substring(url.LastIndexOf('=') + 1)).Replace("%22", "");
                }
            }
            else
            {
                path = Path.Combine(o.Path, "unknown", url.Substring(url.LastIndexOf('=') + 1)).Replace("%22", "");
            }
            path = path.Replace("%20", " ").Replace("%2C", " ");
            DlTool.downLoadFile(url, path, DlConfig.useProxy, content);
        }
Esempio n. 4
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. 5
0
        public void Download(object obj)
        {
            AsynObj o = (AsynObj)obj;

            try
            {
                string[] threads1 = o.Content.Split(new string[] { "版块主题" }, StringSplitOptions.RemoveEmptyEntries);
                string[] threads  = threads1[1].Split(new string[] { "normalthread_", "pages_btns" }, StringSplitOptions.RemoveEmptyEntries);
                foreach (string thread in threads)
                {
                    if (thread.Contains("新窗口打开"))
                    {
                        string path;
                        if (thread.Contains("color:"))
                        {
                            path = Path.Combine(o.Path, DlTool.ReplaceUrl(nameRegex1.Match(nameRegex.Match(thread).Value).Value));
                        }
                        else
                        {
                            path = Path.Combine(o.Path, DlTool.ReplaceUrl(nameRegex1.Match(noColorNameRegex.Match(thread).Value).Value));
                        }
                        double size = 0;
                        try
                        {
                            string sizeStr            = sizeRegex.Matches(thread)[1].Value.Replace("<td class=\"nums\">", "").Replace(" /", "").ToUpper();
                            string sizeStrWithoutUnit = sizeStr.Replace("GB", "").Replace("G", "").Replace("MB", "").Replace("M", "");
                            size = Convert.ToDouble(sizeStrWithoutUnit);
                            if (sizeStr.Contains("G"))
                            {
                                size = size * 1024;
                            }
                        }
                        catch
                        {
                            Console.WriteLine("Can not get Size:  " + thread);
                        }
                        path += " size^^^" + size + ".htm";
                        string link = "http://sis001.com/bbs/" + threadRegex.Match(thread).Value.Replace("href=\"", "").Replace("\" title=\"新窗口打开\" target=\"_blank\"><", "");
                        ThreadPool.QueueUserWorkItem(new Sis001SgDl().work, new AsynObj(path, link));
                    }
                }
            }
            catch (Exception e)
            {
                Config1.appendFile(o.Url, Path.Combine(o.Path, "failList.txt"));
            }
        }
Esempio n. 6
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. 7
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. 8
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. 9
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. 10
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. 11
0
        public void Download(object obj)
        {
            AsynObj o = (AsynObj)obj;

            try
            {
                string[] threads = o.Content.Split(new string[] { "新窗口打开" }, StringSplitOptions.RemoveEmptyEntries);
                foreach (string thread in threads)
                {
                    if (thread.Contains("桃花族论坛"))
                    {
                        continue;
                    }

                    string path = Path.Combine(o.Path, DlTool.ReplaceUrl(nameRegex1.Match(nameRegex.Match(thread).Value).Value)) + ".htm";
                    string link = "http://taohuabt.info/" + threadRegex.Matches(thread)[0].Value.Replace("\"", "");
                    ThreadPool.QueueUserWorkItem(new ThzSgDl().work, new AsynObj(path, link));
                }
            }
            catch (Exception e)
            {
                Config1.appendFile(o.Url, Path.Combine(o.Path, "failList.txt"));
            }
        }
Esempio n. 12
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");
            }
        }