Ejemplo n.º 1
0
        public static async Task <bool> DownActress(string ID, string Name)
        {
            bool   result = false;
            string Url = RootUrl.Bus + $"star/{ID}";
            string Content; int StatusCode; string ResultMessage;

            (Content, StatusCode) = await Http(Url);

            if (StatusCode == 200 && Content != "")
            {
                //id搜索
                BusParse busParse = new BusParse(ID, Content, VedioType.骑兵);
                Actress  actress  = busParse.ParseActress();
                if (actress.birthday == "" && actress.age == 0 && actress.birthplace == "")
                {
                    Console.WriteLine($"该网址无演员信息:{Url}"); ResultMessage = "该网址无演员信息=>Bus"; Logger.LogN($"URL={Url},Message-{ResultMessage}");
                }
                else
                {
                    actress.sourceurl = Url;
                    actress.source    = "javbus";
                    actress.id        = ID;
                    actress.name      = Name;
                    //保存信息
                    DataBase.InsertActress(actress);

                    result = true;
                }
            }
            else
            {
                Console.WriteLine($"无法访问 404:{Url}"); ResultMessage = "无法访问=>Bus"; Logger.LogN($"URL={Url},Message-{ResultMessage}");
            }
            return(result);
        }
Ejemplo n.º 2
0
        protected override Dictionary <string, string> GetInfo()
        {
            Dictionary <string, string> Info = new BusParse(ID, httpResult.SourceCode, VedioType).Parse();

            if (Info.Count > 0)
            {
                Info.Add("sourceurl", Url);
                Info.Add("source", "javbus");
                Task.Delay(Delay.SHORT_3).Wait();
            }
            return(Info);
        }
Ejemplo n.º 3
0
        protected override Dictionary <string, string> GetInfo()
        {
            Dictionary <string, string> Info = new BusParse(ID, Content, VedioType).Parse();

            if (Info.Count > 0)
            {
                Info.Add("sourceurl", Url);
                Info.Add("source", "javbus");
                Task.Delay(TASKDELAY_SHORT).Wait();
            }
            return(Info);
        }
Ejemplo n.º 4
0
        protected override Dictionary <string, string> GetInfo()
        {
            Dictionary <string, string> Info = new BusParse(ID, Content, VedioType).Parse();

            if (Info.Count <= 0)
            {
                Console.WriteLine($"解析失败:{Url}"); resultMessage = "Parse Fail=>Bus"; Logger.LogN($"URL={Url},Message-{resultMessage}");
            }
            else
            {
                Info.Add("sourceurl", Url);
                Info.Add("source", "javbus");
                Task.Delay(TASKDELAY_SHORT).Wait();
            }
            return(Info);
        }
Ejemplo n.º 5
0
        public static async Task <bool> DownLoadActress(string ID, string Name, Action <string> callback)
        {
            bool       result     = false;
            string     Url        = JvedioServers.Bus.Url + $"star/{ID}";
            HttpResult httpResult = null;

            httpResult = await Http(Url);

            string error = "";

            if (httpResult != null && httpResult.StatusCode == HttpStatusCode.OK && httpResult.SourceCode != "")
            {
                //id搜索
                BusParse busParse = new BusParse(ID, httpResult.SourceCode, VedioType.骑兵);
                Actress  actress  = busParse.ParseActress();
                if (actress == null && string.IsNullOrEmpty(actress.birthday) && actress.age == 0 && string.IsNullOrEmpty(actress.birthplace))
                {
                    error = $"{Jvedio.Language.Resources.NoActorInfo}:{Url}";
                }
                else
                {
                    actress.sourceurl = Url;
                    actress.source    = "javbus";
                    actress.id        = ID;
                    actress.name      = Name;
                    //保存信息
                    DataBase.InsertActress(actress);
                    result = true;
                }
            }
            else if (httpResult != null)
            {
                error = httpResult.StatusCode.ToStatusMessage();
            }
            else
            {
                error = Jvedio.Language.Resources.HttpFail;
            }
            Console.WriteLine(error);
            callback.Invoke(error);
            Logger.LogN($"URL={Url},Message-{error}");
            return(result);
        }
Ejemplo n.º 6
0
        public static async Task <bool> DownActress(string ID, string Name, Action <string> callback)
        {
            bool   result = false;
            string Url = RootUrl.Bus + $"star/{ID}";
            string Content; int StatusCode; string ResultMessage;

            (Content, StatusCode) = await Http(Url);

            if (StatusCode == 200 && Content != "")
            {
                //id搜索
                BusParse busParse = new BusParse(ID, Content, VedioType.骑兵);
                Actress  actress  = busParse.ParseActress();
                if (actress == null && string.IsNullOrEmpty(actress.birthday) && actress.age == 0 && string.IsNullOrEmpty(actress.birthplace))
                {
                    ResultMessage = $"{Jvedio.Language.Resources.NoActorInfo}:{Url}";
                    callback.Invoke(ResultMessage);
                    Logger.LogN($"URL={Url},Message-{ResultMessage}");
                }
                else
                {
                    actress.sourceurl = Url;
                    actress.source    = "javbus";
                    actress.id        = ID;
                    actress.name      = Name;
                    //保存信息
                    DataBase.InsertActress(actress);

                    result = true;
                }
            }
            else
            {
                Console.WriteLine($"{"404".ToStatusMessage()}:{Url}");
                ResultMessage = "Bus" + "404".ToStatusMessage();
                callback.Invoke(ResultMessage);
                Logger.LogN($"URL={Url},Message-{ResultMessage}");
            }
            return(result);
        }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
        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);
        }