public static CookieContainer GetJavBusCookie() { var index = "https://www.javbus.com"; var result = HtmlManager.GetCookies(index); CookieContainer cc = new CookieContainer(); cc.Add(result); return(cc); }
public static List <RefreshModel> GetJavbusAVList(string url, int page, bool onlyMag = true) { List <RefreshModel> ret = new List <RefreshModel>(); var cc = HtmlManager.GetCookies("https://www.javbus.com"); if (onlyMag) { cc.Add(new Cookie() { Domain = "www.javbus.com", Name = "existmag", Value = "mag" }); } else { cc.Add(new Cookie() { Domain = "www.javbus.com", Name = "existmag", Value = "all" }); } var c = new CookieContainer(); c.Add(cc); for (int i = 1; i <= page; i++) { var htmlResult = HtmlManager.GetHtmlContentViaUrl(url + "/" + i, "utf-8", true, c); if (htmlResult.Success) { HtmlDocument htmlDocument = new HtmlDocument(); htmlDocument.LoadHtml(htmlResult.Content); var itemPath = "//div[@class='item']"; var itemNodes = htmlDocument.DocumentNode.SelectNodes(itemPath); foreach (var item in itemNodes) { if (!item.InnerHtml.Contains("avatar-box")) { RefreshModel temp = new RefreshModel(); var itemUrl = item.ChildNodes[1].Attributes["href"].Value; var id = itemUrl.Substring(itemUrl.LastIndexOf("/") + 1); var name = item.ChildNodes[1].ChildNodes[1].ChildNodes[1].Attributes["title"].Value; var pic = item.ChildNodes[1].ChildNodes[1].ChildNodes[1].Attributes["src"].Value; temp.Id = id; temp.Name = name; temp.Url = pic.Replace("https://pics.javbus.com/thumb/", "https://pics.javbus.com/cover/").Replace(".jpg", "_b.jpg"); ret.Add(temp); } } } } return(ret); }