Ejemplo 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);
        }
Ejemplo n.º 2
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"));
            }
        }
Ejemplo n.º 3
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);
            }
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
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);
            }
        }
Ejemplo n.º 6
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);
            }
        }
Ejemplo n.º 7
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"));
            }
        }