void CatchActress(string version) { string[] prefixs = new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }; int page = 1; foreach (var prefix in prefixs) { while (page < 100) { string url = string.Format(Config.Actress_URL, prefix, page); HttpHandler hdler = new HttpHandler(); string response = hdler.WebRequest(HttpMethd.GET, url, null); Actress[] acts = Actress.GetActressFromHtml(response); if (acts.Length > 0) { foreach (var act in acts) { act.Prefix = prefix; act.Save(version); } Info(prefix + "开头女优第" + page + "页收录" + acts.Length + "个", version, -1, "actress"); } else { break; } page++; } page = 1; } }
void CatchVideoInfo(string version, int thcount, int thindex) { while (true) { var act = Video.GetActressNotVersion(version, thcount, thindex); try { if (act == null) { break; } string url = string.Format(Config.Actress_video_detail_URL, act.JL_Id); HttpHandler hdler = new HttpHandler(); string response = hdler.WebRequest(HttpMethd.GET, url, null); act.UpdateDetailFromHtml(response); act.Save(version); Info("id:" + act.Id + "收录完成", version, act.Id, "videoInfo"); } catch (System.Exception ex) { LogHandler.Log(LogLevel.Error, version, "id:" + act.Id + "收录失败:" + ex.Message, act.Id, "videoInfo"); } } Info("抓取完成", version, -1, "videoInfo"); }
void CatchVideo(string version, int thcount, int thindex) { while (true) { var act = Actress.GetActressNotVersion(version, true, thcount, thindex); try { if (act == null) { break; } int page = 1; while (page < 100) { string url = string.Format(Config.Actress_video_list_URL, act.JL_Id, page); HttpHandler hdler = new HttpHandler(); string response = hdler.WebRequest(HttpMethd.GET, url, null); Video[] vs = Video.GetVideoListFromHtml(response); if (vs.Length > 0) { foreach (var v in vs) { v.Save(version, act.Id); } } else { break; } page++; } Info("id:" + act.Id + "收录完成", version, act.Id, "video"); } catch (System.Exception ex) { LogHandler.Log(LogLevel.Error, version, "id:" + act.Id + "收录失败:" + ex.Message, act.Id, "video"); } } Info("抓取完成", version, -1, "video"); }