private static MangaPicturesVM GetMangePicHanhan(MangaCategorySourceType sourceType, string path) { MangaPicturesVM ret = new MangaPicturesVM(); ret.PicList = new List <string>(); var htmlRet = HtmlManager.GetHtmlWebClient("http://www.hanhan.net", path); if (htmlRet.Success) { try { HtmlDocument htmlDocument = new HtmlDocument(); htmlDocument.LoadHtml(htmlRet.Content); var urlPath = "//link[@rel='miphtml']"; var urlNode = htmlDocument.DocumentNode.SelectSingleNode(urlPath); var decrypt = htmlRet.Content.Substring(htmlRet.Content.IndexOf("chapterImages = ") + "chapterImages = ".Length); decrypt = decrypt.Substring(0, decrypt.IndexOf("]") + 1); var urlHeader = htmlRet.Content.Substring(htmlRet.Content.IndexOf("chapterPath = \"") + "chapterPath = \"".Length); urlHeader = urlHeader.Substring(0, urlHeader.IndexOf("\"")); var picList = JsonConvert.DeserializeObject <List <string> >(decrypt); foreach (var pic in picList) { if (!pic.StartsWith("http")) { ret.PicList.Add("http://img001.shaque.vip/" + urlHeader + pic); } else { ret.PicList.Add(pic); } } } catch (Exception e) { ret.MsgCode = VMCode.Exception; ret.Msg = e.ToString(); } } else { ret.MsgCode = VMCode.Error; ret.Msg = "获取网页失败"; } return(ret); }
public static MangaPicturesVM GetMangaPic(MangaCategorySourceType sourceType, string path) { MangaPicturesVM ret = new MangaPicturesVM(); switch (sourceType) { case MangaCategorySourceType.憨憨漫画: ret = GetMangePicHanhan(sourceType, path); break; } return(ret); }