protected override Dictionary <string, string> GetInfo() { Dictionary <string, string> Info = new JavDBParse(ID, httpResult.SourceCode, MovieCode).Parse(); if (Info.Count > 0) { Info.Add("id", ID); Info.Add("sourceurl", Url); Info.Add("source", "javdb"); Task.Delay(Delay.MEDIUM).Wait(); } return(Info); }
protected override Dictionary <string, string> GetInfo() { Dictionary <string, string> Info = new Dictionary <string, string>(); Info = new JavDBParse(ID, Content, MovieCode).Parse(); if (Info.Count <= 0) { Console.WriteLine($"解析失败:{Url}"); resultMessage = "Parse Fail=>DB"; Logger.LogN($"URL={Url},Message-{resultMessage}"); } else { Info.Add("sourceurl", Url); Info.Add("source", "javdb"); Task.Delay(TASKDELAY_MEDIUM).Wait(); } return(Info); }
protected override Dictionary <string, string> GetInfo() { Dictionary <string, string> Info = new JavDBParse(ID, Content, MovieCode).Parse(); if (Info.Count <= 0) { Console.WriteLine($"{Jvedio.Language.Resources.Url}:{Url}"); resultMessage = $"{Jvedio.Language.Resources.Url}:{Url},{Jvedio.Language.Resources.Reason}:{Jvedio.Language.Resources.ParseFail}!"; Logger.LogN(resultMessage); } else { Info.Add("id", ID); Info.Add("sourceurl", Url); Info.Add("source", "javdb"); Task.Delay(TASKDELAY_MEDIUM).Wait(); } return(Info); }
protected override Dictionary <string, string> GetInfo() { Dictionary <string, string> Info = new JavDBParse(ID, Content, MovieCode).Parse(); if (Info.Count <= 0) { Console.WriteLine($"解析失败:{Url}"); resultMessage = $"地址:{Url},失败原因:无法解析!"; Logger.LogN(resultMessage); } else { Info.Add("id", ID); Info.Add("sourceurl", Url); Info.Add("source", "javdb"); Task.Delay(TASKDELAY_MEDIUM).Wait(); } return(Info); }
public static async Task <bool> ParseSpecifiedInfo(WebSite webSite, string id, string url) { string content = ""; int StatusCode = 404; if (webSite == WebSite.DB) { (content, StatusCode) = await Net.Http(url, Cookie : Properties.Settings.Default.DBCookie); } if (webSite == WebSite.DMM) { (content, StatusCode) = await Net.Http(url, Cookie : Properties.Settings.Default.DMMCookie); } else { (content, StatusCode) = await Net.Http(url); } if (StatusCode != 200 || content == "") { return(false); } else { Dictionary <string, string> Info = new Dictionary <string, string>(); if (webSite == WebSite.Bus) { Info = new BusParse(id, content, Identify.GetVedioType(id)).Parse(); Info.Add("source", "javbus"); } else if (webSite == WebSite.BusEu) { Info = new BusParse(id, content, VedioType.欧美).Parse(); Info.Add("source", "javbus"); } else if (webSite == WebSite.DB) { Info = new JavDBParse(id, content, url.Split('/').Last()).Parse(); Info.Add("source", "javdb"); } else if (webSite == WebSite.Library) { Info = new LibraryParse(id, content).Parse(); Info.Add("source", "javlibrary"); } Info.Add("sourceurl", url); if (Info.Count > 2) { //保存信息 Info["id"] = id; DataBase.UpdateInfoFromNet(Info); DetailMovie detailMovie = DataBase.SelectDetailMovieById(id); //nfo 信息保存到视频同目录 if (Properties.Settings.Default.SaveInfoToNFO) { if (Directory.Exists(Properties.Settings.Default.NFOSavePath)) { //固定位置 nfo.SaveToNFO(detailMovie, Path.Combine(Properties.Settings.Default.NFOSavePath, $"{id}.nfo")); } else { //与视频同路径 string path = detailMovie.filepath; if (System.IO.File.Exists(path)) { nfo.SaveToNFO(detailMovie, Path.Combine(new FileInfo(path).DirectoryName, $"{id}.nfo")); } } } return(true); } } return(false); }
public static async Task <bool> ParseSpecifiedInfo(WebSite webSite, string id, string url) { HttpResult httpResult = null; if (webSite == WebSite.Bus) { httpResult = await Net.Http(url, new CrawlerHeader() { Cookies = JvedioServers.Bus.Cookie }); } else if (webSite == WebSite.BusEu) { httpResult = await Net.Http(url, new CrawlerHeader() { Cookies = JvedioServers.BusEurope.Cookie }); } else if (webSite == WebSite.Library) { httpResult = await Net.Http(url, new CrawlerHeader() { Cookies = JvedioServers.Library.Cookie }); } else if (webSite == WebSite.Jav321) { httpResult = await Net.Http(url, new CrawlerHeader() { Cookies = JvedioServers.Jav321.Cookie }); } else if (webSite == WebSite.FC2) { httpResult = await Net.Http(url, new CrawlerHeader() { Cookies = JvedioServers.FC2.Cookie }); } else if (webSite == WebSite.DB) { httpResult = await Net.Http(url, new CrawlerHeader() { Cookies = JvedioServers.DB.Cookie }); } else if (webSite == WebSite.DMM) { httpResult = await Net.Http(url, new CrawlerHeader() { Cookies = JvedioServers.DMM.Cookie }); } else if (webSite == WebSite.MOO) { httpResult = await Net.Http(url, new CrawlerHeader() { Cookies = JvedioServers.MOO.Cookie }); } else { httpResult = await Net.Http(url); } if (httpResult != null && httpResult.StatusCode == HttpStatusCode.OK && httpResult.SourceCode != "") { string content = httpResult.SourceCode; Dictionary <string, string> Info = new Dictionary <string, string>(); if (webSite == WebSite.Bus) { Info = new BusParse(id, content, Identify.GetVideoType(id)).Parse(); Info.Add("source", "javbus"); } else if (webSite == WebSite.BusEu) { Info = new BusParse(id, content, VedioType.欧美).Parse(); Info.Add("source", "javbus"); } else if (webSite == WebSite.DB) { Info = new JavDBParse(id, content, url.Split('/').Last()).Parse(); Info.Add("source", "javdb"); } else if (webSite == WebSite.Library) { Info = new LibraryParse(id, content).Parse(); Info.Add("source", "javlibrary"); } else if (webSite == WebSite.Jav321) { Info = new LibraryParse(id, content).Parse(); Info.Add("source", "Jav321"); } else if (webSite == WebSite.DMM) { Info = new LibraryParse(id, content).Parse(); Info.Add("source", "DMM"); } else if (webSite == WebSite.MOO) { Info = new LibraryParse(id, content).Parse(); Info.Add("source", "MOO"); } else if (webSite == WebSite.FC2) { Info = new LibraryParse(id, content).Parse(); Info.Add("source", "FC2"); } Info.Add("sourceurl", url); if (Info.Count > 2) { FileProcess.SaveInfo(Info, id); return(true); } } return(false); }