Example #1
0
 public override string GetPageString(int page, int count, string keyWord, System.Net.IWebProxy proxy)
 {
     string address = string.Format(SiteUrl + "/posts?page={0}&limit={1}&tags={2}", page, count, keyWord);
     if (keyWord.Length == 0)
     {
         address = address.Substring(0, address.Length - 6);
     }
     MyWebClient client = new MyWebClient
     {
         Proxy = proxy,
         Encoding = Encoding.UTF8
     };
     string pageString = client.DownloadString(address);
     client.Dispose();
     return pageString;
 }
Example #2
0
        public override string GetPageString(int page, int count, string keyWord, System.Net.IWebProxy proxy)
        {
            //http://worldcosplay.net/api/photo/list?page=3&limit=2&sort=created_at&direction=descend
            string url = SiteUrl + "/api/photo/list?page=" + page + "&limit=" + count + "&sort=created_at&direction=descend";

            MyWebClient web = new MyWebClient();
            web.Proxy = proxy;
            web.Encoding = Encoding.UTF8;

            if (keyWord.Length > 0)
            {
                //http://worldcosplay.net/api/photo/search?page=2&rows=48&q=%E5%90%8A%E5%B8%A6%E8%A2%9C%E5%A4%A9%E4%BD%BF
                url = SiteUrl + "/api/photo/search?page=" + page + "&rows=" + count + "&q=" + keyWord;
            }

            string pageString = web.DownloadString(url);
            web.Dispose();

            return pageString;
        }
Example #3
0
        public override string GetPageString(int page, int count, string keyWord, System.Net.IWebProxy proxy)
        {
            //http://chan.sankakucomplex.com/post/index.content?page=2&limit=3&tags=xxx
            string url = SiteUrl + "/post/index.content?page=" + page + "&limit=" + count;

            MyWebClient web = new MyWebClient();
            web.Proxy = proxy;
            //web.Headers["Cookie"] = sessionId;
            web.Encoding = Encoding.UTF8;

            if (keyWord.Length > 0)
            {
                url += "&tags=" + keyWord;
            }

            string pageString = web.DownloadString(url);
            web.Dispose();

            return pageString;
        }
Example #4
0
        public override string GetPageString(int page, int count, string keyWord, System.Net.IWebProxy proxy)
        {
            Login(proxy);

            //http://mjv-art.org/pictures/view_posts/0?lang=en
            string url = SiteUrl + "/pictures/view_posts/" + (page - 1) + "?lang=en";

            MyWebClient web = new MyWebClient();
            web.Proxy = proxy;
            web.Headers["Cookie"] = sessionId;
            web.Encoding = Encoding.UTF8;

            if (keyWord.Length > 0)
            {
                //http://mjv-art.org/pictures/view_posts/0?search_tag=suzumiya%20haruhi&order_by=date&ldate=0&lang=en
                url = SiteUrl + "/pictures/view_posts/" + (page - 1) + "?search_tag=" + keyWord + "&order_by=date&ldate=0&lang=en";
            }

            string pageString = web.DownloadString(url);
            web.Dispose();

            return pageString;
        }
Example #5
0
        /// <summary>
        /// get images sync
        /// </summary>
        //public List<Img> GetImages(int page, int count, string keyWord, int maskScore, int maskRes, ViewedID lastViewed, bool maskViewed, System.Net.IWebProxy proxy, bool showExplicit)
        //{
        //    return GetImages(GetPageString(page, count, keyWord, proxy), maskScore, maskRes, lastViewed, maskViewed, proxy, showExplicit);
        //}

        public override string GetPageString(int page, int count, string keyWord, System.Net.IWebProxy proxy)
        {
            Login(proxy);

            //http://gallery.minitokyo.net/scans?order=id&display=extensive&page=2
            string url = "http://gallery.minitokyo.net/" + type + "?order=id&display=extensive&page=" + page;

            MyWebClient web = new MyWebClient();
            web.Proxy = proxy;
            web.Headers["Cookie"] = sessionId;
            web.Encoding = Encoding.UTF8;

            if (keyWord.Length > 0)
            {
                //先使用关键词搜索,然后HTTP 303返回实际地址
                //http://www.minitokyo.net/search?q=haruhi
                url = SiteUrl + "/search?q=" + keyWord;
                System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
                req.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
                req.Proxy = proxy;
                req.Timeout = 8000;
                req.Method = "GET";
                //prevent 303 See Other
                req.AllowAutoRedirect = false;
                System.Net.WebResponse rsp = req.GetResponse();
                //http://www.minitokyo.net/Haruhi+Suzumiya
                //HTTP 303然后返回实际地址
                string location = rsp.Headers["Location"];
                rsp.Close();
                if (location != null && location.Length > 0)
                {
                    //非完整地址,需要前缀
                    url = SiteUrl + location;
                    //再次访问,得到真实列表页地址...
                    string html = web.DownloadString(url);
                    //http://browse.minitokyo.net/gallery?tid=2112&amp;index=1 WALL
                    //http://browse.minitokyo.net/gallery?tid=2112&amp;index=3 SCAN
                    //http://browse.minitokyo.net/gallery?tid=2112&index=1&order=id
                    int urlIndex = html.IndexOf("http://browse.minitokyo.net/gallery?tid=");
                    if (type == WALL)
                    {
                        url = html.Substring(urlIndex, html.IndexOf('"', urlIndex) - urlIndex - 1) + "1";
                    }
                    else
                    {
                        url = html.Substring(urlIndex, html.IndexOf('"', urlIndex) - urlIndex - 1) + "3";
                    }
                    //http://browse.minitokyo.net/gallery?tid=2112&amp%3Bindex=1&order=id&display=extensive
                    url += "&order=id&display=extensive&page=" + page;
                    url = url.Replace("&amp;", "&");
                }
                else
                {
                    throw new Exception("搜索失败,请检查您输入的关键词");
                }
            }

            string pageString = web.DownloadString(url);
            web.Dispose();

            return pageString;
        }
Example #6
0
        /// <summary>
        /// get images sync
        /// </summary>
        //public List<Img> GetImages(int page, int count, string keyWord, int maskScore, int maskRes, ViewedID lastViewed, bool maskViewed, System.Net.IWebProxy proxy, bool showExplicit)
        //{
        //    return GetImages(GetPageString(page, count, keyWord, proxy), maskScore, maskRes, lastViewed, maskViewed, proxy, showExplicit);
        //}

        public override string GetPageString(int page, int count, string keyWord, System.Net.IWebProxy proxy)
        {
            Login(proxy);

            string url = SiteUrl + "/?p=" + page;

            MyWebClient web = new MyWebClient();
            web.Proxy = proxy;
            web.Headers["Cookie"] = sessionId;
            web.Encoding = Encoding.UTF8;

            if (keyWord.Length > 0)
            {
                //先使用关键词搜索,然后HTTP 301返回实际地址
                //http://www.zerochan.net/search?q=tony+taka
                url = SiteUrl + "/search?q=" + keyWord;
                System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
                req.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
                req.Proxy = proxy;
                req.Timeout = 8000;
                req.Method = "GET";
                //prevent 301
                req.AllowAutoRedirect = false;
                System.Net.WebResponse rsp = req.GetResponse();
                //http://www.zerochan.net/Tony+Taka?p=1
                //HTTP 301然后返回实际地址
                string location = rsp.Headers["Location"];
                rsp.Close();
                if (location != null && location.Length > 0)
                {
                    //非完整地址,需要前缀
                    url = SiteUrl + location + "?p=" + page;
                }
                else
                {
                    throw new Exception("搜索失败,请检查您输入的关键词");
                }
            }

            string pageString = web.DownloadString(url);
            web.Dispose();

            return pageString;
        }
Example #7
0
        /// <summary>
        /// get images sync
        /// </summary>
        //public List<Img> GetImages(int page, int count, string keyWord, int maskScore, int maskRes, ViewedID lastViewed, bool maskViewed, System.Net.IWebProxy proxy, bool showExplicit)
        //{
        //    return GetImages(GetPageString(page, count, keyWord, proxy), maskScore, maskRes, lastViewed, maskViewed, proxy, showExplicit);
        //}

        public override string GetPageString(int page, int count, string keyWord, System.Net.IWebProxy proxy)
        {
            string url = SiteUrl + "/?page=" + page;

            MyWebClient web = new MyWebClient();
            web.Proxy = proxy;
            web.Encoding = Encoding.UTF8;

            if (keyWord.Length > 0)
            {
                url = SiteUrl + "/search/process/";
                //multi search
                string data = "tags=" + keyWord + "&source=&char=&artist=&postcontent=&txtposter=";
                if (type == 2)
                {
                    data = "tags=&source=" + keyWord + "&char=&artist=&postcontent=&txtposter=";
                }
                else if (type == 3)
                {
                    data = "tags=&source=&char=&artist=" + keyWord + "&postcontent=&txtposter=";
                }
                else if (type == 4)
                {
                    data = "tags=&source=&char=" + keyWord + "&artist=&postcontent=&txtposter=";
                }

                //e-shuushuu需要将关键词转换为tag id,然后进行搜索
                System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
                req.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
                req.Proxy = proxy;
                req.Timeout = 8000;
                req.Method = "POST";
                //prevent 303
                req.AllowAutoRedirect = false;
                byte[] buf = Encoding.UTF8.GetBytes(data);
                req.ContentType = "application/x-www-form-urlencoded";
                req.ContentLength = buf.Length;
                System.IO.Stream str = req.GetRequestStream();
                str.Write(buf, 0, buf.Length);
                str.Close();
                System.Net.WebResponse rsp = req.GetResponse();
                //http://e-shuushuu.net/search/results/?tags=2
                //HTTP 303然后返回实际地址
                string location = rsp.Headers["Location"];
                rsp.Close();
                if (location != null && location.Length > 0)
                {
                    //非完整地址,需要前缀
                    url = rsp.Headers["Location"] + "&page=" + page;
                }
                else
                {
                    throw new Exception("搜索失败,请检查您输入的关键词");
                }
            }

            string pageString = web.DownloadString(url);
            web.Dispose();

            return pageString;
        }
Example #8
0
        public override string GetPageString(int page, int count, string keyWord, System.Net.IWebProxy proxy)
        {
            //if (page > 1000) throw new Exception("页码过大,若需浏览更多图片请使用关键词限定范围");
            Login(proxy);

            //http://www.pixiv.net/new_illust.php?p=2
            string url = SiteUrl + "/new_illust.php?p=" + page;

            MyWebClient web = new MyWebClient();
            web.Proxy = proxy;
            web.Headers["Cookie"] = cookie;
            web.Encoding = Encoding.UTF8;

            if (keyWord.Length > 0)
            {
                //http://www.pixiv.net/search.php?s_mode=s_tag&word=hatsune&order=date_d&p=2
                url = SiteUrl + "/search.php?s_mode=s_tag&word=" + keyWord + "&order=date_d&p=" + page;
            }
            if (srcType == PixivSrcType.Author)
            {
                int memberId = 0;
                if (keyWord.Trim().Length == 0 || !int.TryParse(keyWord.Trim(), out memberId))
                {
                    throw new Exception("必须在关键词中指定画师 id;若需要使用标签进行搜索请使用 www.pixiv.net [TAG]");
                }
                //member id
                url = SiteUrl + "/member_illust.php?id=" + memberId + "&p=" + page;
            }
            else if (srcType == PixivSrcType.Day)
            {
                url = SiteUrl + "/ranking.php?mode=daily&p=" + page;
            }
            else if (srcType == PixivSrcType.Week)
            {
                url = SiteUrl + "/ranking.php?mode=weekly&p=" + page;
            }
            else if (srcType == PixivSrcType.Month)
            {
                url = SiteUrl + "/ranking.php?mode=monthly&p=" + page;
            }

            string pageString = web.DownloadString(url);
            web.Dispose();

            return pageString;
        }