Ejemplo n.º 1
0
        public override DownLoadComic GetDownImageList(string response)//给出某一话所有下载链接
        {
            DownLoadComic comic = new DownLoadComic();

            try
            {
                Regex[] regex = new Regex[2];
                regex[0] = new Regex(@"(sFiles|lf\d+)=""(?<key>\w+)""");
                regex[1] = new Regex(@"sPath=""(?<path>[\w/]*)""");
                var      host    = "http://comic.jmydm.com:8080/";
                var      sFile   = regex[0].Match(response).Groups["key"].Value;
                var      sPath   = regex[1].Match(response).Groups["path"].Value;
                var      urlList = new List <string>();
                var      sk      = "kxnelimwzsb";
                var      dat     = unsuan(sFile, sk);
                string[] file    = dat.Split('|');

                foreach (var i in file)
                {
                    urlList.Add(host + sPath + i);
                }

                comic.Count     = urlList.Count;
                comic.ImageList = urlList;
            }
            catch (Exception ex)
            {
            }

            return(comic);
        }
Ejemplo n.º 2
0
        public override DownLoadComic GetDownImageList(string response)
        {
            int           index    = 0;
            string        fileName = "";
            string        srcUrl   = "";
            string        basicUrl = "";
            List <string> urlList;

            urlList = new List <string>();
            DownLoadComic comic = new DownLoadComic();
            HtmlDocument  doc   = new HtmlDocument();

            doc.LoadHtml(response);
            HtmlNode showNode = doc.DocumentNode.SelectSingleNode("//img[@id='caonima']");

            srcUrl   = showNode.Attributes["src"].Value;
            index    = srcUrl.LastIndexOf("/");
            basicUrl = srcUrl.Substring(0, index);
            fileName = srcUrl.Substring(srcUrl.LastIndexOf("."));
            Regex regex = new Regex(@"共(?<data>\d+)頁");
            int   count = Convert.ToInt32(regex.Match(response).Groups["data"].Value);

            for (int i = 1; i < count; i++)
            {
                urlList.Add(basicUrl + "/" + i.ToString().PadLeft(3, '0') + fileName);
            }

            comic.Count     = count;
            comic.ImageList = urlList;
            return(comic);
        }
Ejemplo n.º 3
0
        public override DownLoadComic GetDownImageList(string response)
        {
            var           retMsg = "";
            DownLoadComic comic  = new DownLoadComic();

            Regex [] regex = new Regex[4];
            regex[0] = new Regex(@"id=""hdPageCount""\svalue=""(?<count>\d+)""");
            regex[1] = new Regex(@"id=""hdVolID""\svalue=""(?<sid>\d+)""");
            regex[2] = new Regex(@"id=""hdS""\svalue=""(?<hds>\d+)""");
            regex[3] = new Regex(@"id=""hdPageIndex""\svalue=""(?<index>\d+)""");
            var comicCout    = Convert.ToInt32(regex[0].Match(response).Groups["count"].Value);
            var sid          = Convert.ToInt32(regex[1].Match(response).Groups["sid"].Value);
            var s            = Convert.ToInt32(regex[2].Match(response).Groups["hds"].Value);
            var currtntIndex = Convert.ToInt32(regex[3].Match(response).Groups["index"].Value);

            List <string> urlList  = new List <string>();
            List <string> htmlList = new List <string>();
            var           html     = "";

            for (int i = currtntIndex; i < comicCout; i++)
            {
                html = hostAttach + "/" + "cool" + sid + "/" + i.ToString() + ".html?s=" + s;
                htmlList.Add(html);
            }

            foreach (var i in htmlList)
            {
                retMsg = AnalyseTool.HttpGet(i, Encoding.UTF8);
                urlList.Add(GetImageUrl(retMsg));
            }

            comic.ImageList = urlList;
            comic.Count     = urlList.Count;
            return(comic);
        }
Ejemplo n.º 4
0
        public override DownLoadComic GetDownImageList(string response)
        {
            HtmlDocument doc;

            doc = new HtmlDocument();
            doc.LoadHtml(response);
            DownLoadComic down     = new DownLoadComic();
            List <string> dataList = GenerateImage(response);//生成图片

            down.Count     = dataList.Count;
            down.ImageList = dataList;
            return(down);
        }
Ejemplo n.º 5
0
        public override DownLoadComic GetDownImageList(string response)
        {
            string       ajaxStr = "";
            string       temp    = "";
            HtmlDocument doc;

            doc = new HtmlDocument();
            doc.LoadHtml(response);
            DownLoadComic down = new DownLoadComic();

            ajaxStr = GenerateAjax(response);

            return(down);
        }
Ejemplo n.º 6
0
        public override DownLoadComic GetDownImageList(string response)
        {
            var           temp  = "";
            DownLoadComic comic = new DownLoadComic();
            HtmlDocument  doc   = new HtmlDocument();

            try
            {
                doc.LoadHtml(response);
                temp            = doc.DocumentNode.SelectSingleNode("//script[@type='text/javascript']").InnerText.Trim();
                comic.ImageList = AnalyseData(response);
                comic.Count     = comic.ImageList.Count;
            }
            catch (Exception ex)
            {
                Console.WriteLine("非常动漫DownLoad函数失败");
            }
            return(comic);
        }
Ejemplo n.º 7
0
        public override DownLoadComic GetDownImageList(string response)
        {
            string        temp     = "";
            DownLoadComic downLoad = new DownLoadComic();
            List <string> imgList  = new List <string>();
            var           ret      = DecodeURL(response);

            ret = ret.Substring(ret.IndexOf("{"), ret.LastIndexOf("}") - ret.IndexOf("{") + 1);
            KanManHuaInfo info = JsonOperate.DeserializeJsonToObject <KanManHuaInfo>(ret);

            foreach (var i in info.files)
            {
                temp = comicAttach + info.path + i + "?cid=" + info.cid + "&md5=" + info.sl.md5;
                imgList.Add(temp);
            }

            downLoad.ImageList = imgList;
            downLoad.Count     = imgList.Count;
            return(downLoad);
        }
Ejemplo n.º 8
0
        public override DownLoadComic GetDownImageList(string response)
        {
            string        host = "";
            List <string> comicList;
            DownLoadComic comic       = new DownLoadComic();
            Regex         regexUrl    = new Regex(@"picAy\[\d+\]=""(?<url>[\w_%-.]*)""");
            Regex         regexDomain = new Regex(@"picHosts\s*=\s*""(?<host>[\w\:/\.]*)""");

            host = regexDomain.Match(response).Groups["host"].Value;

            MatchCollection matchCollect = regexUrl.Matches(response);

            comicList = new List <string>();

            foreach (Match M in matchCollect)
            {
                comicList.Add(host + M.Groups["url"].Value);
            }

            comic.ImageList = comicList;
            comic.Count     = comicList.Count;
            return(comic);
        }
Ejemplo n.º 9
0
        public override DownLoadComic GetDownImageList(string response)
        {
            DownLoadComic comic         = new DownLoadComic();
            string        key           = "123456781234567G";
            string        iv            = "ABCDEF1G34123412";
            var           chapterImages = "";

            Regex regx = new Regex(@"chapterImages\s+\=\s+""(?<url>[\w/\+\-\=]*)""");

            chapterImages = regx.Match(response).Groups["url"].Value;
            string ret = AesDecrypt(chapterImages, key, iv);

            comic.ImageList = new List <string>();
            JArray arry = JArray.Parse(ret);

            foreach (var i in arry)
            {
                comic.ImageList.Add("http://img01.eshanyao.com/showImage.php?url=" + i.ToString());
            }

            comic.Count = comic.ImageList.Count;
            return(comic);
        }
Ejemplo n.º 10
0
        public override DownLoadComic GetDownImageList(string response)
        {
            DownLoadComic downLoad   = new DownLoadComic();
            Regex         urlRegex   = new Regex(@"MANGABZ_CURL\s*=\s*""(?<data>[\w/]*)""");
            Regex         midRegex   = new Regex(@"MANGABZ_MID\s*=\s*(?<data>\d+)");
            Regex         cidRegex   = new Regex(@"MANGABZ_CID=(?<data>\d+)");
            Regex         signRegex  = new Regex(@"MANGABZ_VIEWSIGN=""(?<data>\w+)""");
            Regex         dtRegex    = new Regex(@"MANGABZ_VIEWSIGN_DT=""(?<data>[\w\s\-\:]*)""");
            Regex         countRegex = new Regex(@"MANGABZ_IMAGE_COUNT\s*=\s*(?<data>\d+)");

            var url   = "";
            var mid   = "";
            var cid   = "";
            var sign  = "";
            var dt    = "";
            var count = Convert.ToInt32(countRegex.Match(response).Groups["data"].Value);

            var           requestUrl = "";
            string        temp       = "";
            List <string> urlList    = new List <string>();

            urlList.Add(currentUrl);

            for (int i = 1; i < count + 1; i++)
            {
                temp = currentUrl + "#ipg" + i;
                urlList.Add(temp);
            }

            int pos = 1;

            downLoad.ImageList = new List <string>();

            for (int i = 0; i < urlList.Count; i++)
            {
                response = AnalyseTool.HttpGet(urlList[i]);
                url      = urlRegex.Match(response).Groups["data"].Value;
                mid      = midRegex.Match(response).Groups["data"].Value;
                cid      = cidRegex.Match(response).Groups["data"].Value;
                sign     = signRegex.Match(response).Groups["data"].Value;

                requestUrl = host + string.Format("{0}chapterimage.ashx?cid={1}&page={2}&key=&" +
                                                  "_cid={1}&_mid={3}&_dt={4}&sign={5}", url, cid, pos++, mid, System.Web.HttpUtility.UrlEncode(dt), sign);

                var msg = AnalyseTool.HttpGet(requestUrl, currentUrl);

                if (msg == "")
                {
                    msg = AnalyseTool.HttpGet(requestUrl, currentUrl);
                }

                url = urlRegex.Match(response).Groups["data"].Value;

                if (msg != null && msg.Length > 0)
                {
                    Microsoft.JScript.ArrayObject obj = AnalyseTool.EvalJScript(msg);
                    int len = Convert.ToInt32(obj.length);

                    for (int k = 0; k < len; k++)
                    {
                        string imgUrl = obj[k].ToString();

                        if (downLoad.ImageList.Exists(o => o == imgUrl) == false)
                        {
                            downLoad.ImageList.Add(imgUrl);
                        }
                    }
                }
            }

            downLoad.Count = downLoad.ImageList.Count;
            return(downLoad);
        }
Ejemplo n.º 11
0
        public virtual DownLoadComic GetDownImageList(string response)//获取下载的漫画集合
        {
            DownLoadComic downComic = new DownLoadComic();

            return(downComic);
        }
Ejemplo n.º 12
0
        public override DownLoadComic GetDownImageList(string response)
        {
            string             nextHtml = "";
            List <string>      imageList;
            HtmlDocument       doc;
            HtmlNode           node;
            HtmlNodeCollection nodeCollect;
            DownLoadComic      comic;

            doc = new HtmlDocument();
            doc.LoadHtml(response);
            comic     = new DownLoadComic();
            imageList = new List <string>();

            try
            {
                nodeCollect = doc.DocumentNode.SelectNodes("//img");
                node        = doc.DocumentNode.SelectSingleNode("//input[@id='total']");
                var total = Convert.ToInt32(node.Attributes["value"].Value);

                node = doc.DocumentNode.SelectSingleNode("//input[@id='pos']");
                var pos = Convert.ToInt32(node.Attributes["value"].Value) + 1;
                var cid = Convert.ToInt32(doc.DocumentNode.SelectSingleNode("//input[@id='cid']").Attributes["value"].Value);
                var id  = Convert.ToInt32(doc.DocumentNode.SelectSingleNode("//input[@id='id']").Attributes["value"].Value);

                nextHtml = hostName + "/index-look-cid-" + cid.ToString() + "-id-" + id.ToString() + "-p-" + pos.ToString();

                if (nodeCollect != null && nodeCollect.Count >= 2)
                {
                    imageList = FillImageList(nodeCollect[0].Attributes["src"].Value, nodeCollect[1].Attributes["src"].Value, total);

                    if (imageList.Count == total)
                    {
                        comic.Count     = imageList.Count;
                        comic.ImageList = imageList;
                        return(comic);
                    }
                }

                foreach (HtmlNode temp in nodeCollect)
                {
                    imageList.Add(temp.Attributes["src"].Value);
                }

                for (int i = 0; i < total; i++)
                {
                    response = AnalyseTool.HttpGet(nextHtml, Encoding.UTF8);
                    doc.LoadHtml(response);
                    node        = doc.DocumentNode.SelectSingleNode("//input[@id='pos']");
                    pos         = Convert.ToInt32(node.Attributes["value"].Value) + 1;
                    cid         = Convert.ToInt32(doc.DocumentNode.SelectSingleNode("//input[@id='cid']").Attributes["value"].Value);
                    id          = Convert.ToInt32(doc.DocumentNode.SelectSingleNode("//input[@id='id']").Attributes["value"].Value);
                    nextHtml    = hostName + "/index-look-cid-" + cid.ToString() + "-id-" + id.ToString() + "-p-" + pos.ToString();
                    nodeCollect = doc.DocumentNode.SelectNodes("//img");

                    foreach (HtmlNode temp in nodeCollect)
                    {
                        if (imageList.Contains(temp.Attributes["src"].Value) == false)
                        {
                            imageList.Add(temp.Attributes["src"].Value);
                        }
                    }

                    if (imageList.Count >= total || pos == total)
                    {
                        break;
                    }
                }

                comic.Count     = imageList.Count;
                comic.ImageList = imageList;
            }
            catch (Exception ex)
            {
                Console.WriteLine("KanManHua{0}.GetDownImageList,原因:{1}", ex.Message);
            }
            return(comic);
        }
Ejemplo n.º 13
0
        public override DownLoadComic GetDownImageList(string response)//遍历,需要优化
        {
            int           total = 0;
            HtmlDocument  doc   = new HtmlDocument();
            DownLoadComic comic = new DownLoadComic();

            if (response == "")
            {
                return(comic);
            }

            doc.LoadHtml(response);
            HtmlNode           node    = doc.DocumentNode.SelectSingleNode("//span[@id='k_total']");
            HtmlNodeCollection collect = doc.DocumentNode.SelectNodes("//div[@class='UnderPage']/div");

            string html     = "";
            string htmlData = "";
            string nextPage = "";

            string baseHtml = collect[2].SelectSingleNode("./mip-link").Attributes["href"].Value;

            if (baseHtml.Contains("-"))
            {
                html = baseHtml.Substring(0, baseHtml.LastIndexOf("-"));
            }
            else
            {
                html = baseHtml;
            }

            total = Convert.ToInt32(node.InnerText);
            List <string> list   = new List <string>();
            string        imgUrl = collect[2].SelectSingleNode("./mip-link/mip-img").Attributes["src"].Value;

            list.Add(imgUrl);

            DateTime time = DateTime.Now;

            List <string> urlList = new List <string>();

            for (int i = 2; i < total + 1; i++)
            {
                nextPage = html + "-" + i + ".html";
                urlList.Add(nextPage);
            }

            string[] responseArry = AnalyseTool.HttpGet(urlList.ToArray());
            Console.WriteLine("获取所有访问耗时ms:{0}", DateTime.Now.Subtract(time).TotalMilliseconds);

            foreach (var i in responseArry)
            {
                if (i == "")
                {
                    return(comic);
                }
                doc.LoadHtml(i);
                list.Add(doc.DocumentNode.SelectSingleNode("//mip-img").Attributes["src"].Value);
            }

            comic.ImageList = list;
            comic.Count     = list.Count;
            return(comic);
        }