Пример #1
0
 internal static string Get_Profile(string html)
 {
     profile = new Models.Profile();
     try
     {
         var node = Getnode.GetOneTag(html, "div", "class", "movie-info");
         profile.Name  = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 0, 0 }, "");
         profile.Thumb = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 1, 0, 0 }, "src");
         var nodeInfo = Getnode.GetListNodeToNode(node, new int[] { 0, 0, 0, 1, 0 })[0];
         profile.Birthday = Getnode.GetValueHtmlToChird(nodeInfo, new int[] { 1 }, "");
         profile.Job      = Getnode.GetValueHtmlToChird(nodeInfo, new int[] { 4 }, "");
         profile.Country  = Getnode.GetValueHtmlToChird(nodeInfo, new int[] { 7 }, "");
         profile.Height   = Getnode.GetValueHtmlToChird(nodeInfo, new int[] { 10 }, "");
         profile.Weight   = Getnode.GetValueHtmlToChird(nodeInfo, new int[] { 13 }, "");
         profile.BoolTyle = Getnode.GetValueHtmlToChird(nodeInfo, new int[] { 16 }, "");
         profile.Language = Getnode.GetValueHtmlToChird(nodeInfo, new int[] { 19 }, "");
         profile.Forte    = Getnode.GetValueHtmlToChird(nodeInfo, new int[] { 22 }, "");
         profile.Like     = Getnode.GetValueHtmlToChird(nodeInfo, new int[] { 25 }, "");
         profile.Views    = Getnode.GetValueHtmlToChird(nodeInfo, new int[] { 28 }, "");
         profile.List_Profile_FilmRela = Get_Profile_FilmRela(html);
         json_Profile.status           = true;
     }
     catch
     {
         json_Profile.status = false;
     }
     return(BaseJsonProFile());
 }
Пример #2
0
        internal static string Get_FilmHome(string html)
        {
            listFilmHome = new List <Models.ListFilmHome>();
            try
            {
                var node = Getnode.GetListTag(html, "div", "class", "movie-list-index home-v2");
                foreach (var itemNode in node)
                {
                    Models.ListFilmHome i = new Models.ListFilmHome();

                    i.Title = Getnode.GetValueHtmlToChird(itemNode, new int[] { 0, 0, 0 }, "");
                    var nodeToItemNode = Getnode.GetListNodeToNode(itemNode, new int[] { 1, 0 });
                    foreach (var item in nodeToItemNode[0].ChildNodes)
                    {
                        Models.FilmItem t = new Models.FilmItem();
                        t.UrlFilm = Getnode.GetValueHtmlToChird(item, new int[] { 0 }, "href");
                        var thumb = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 0, 0 }, "style");
                        thumb        = thumb.Replace("background-image:url('", "");
                        thumb        = thumb.Remove(thumb.IndexOf("')"));
                        t.Thumb      = thumb;
                        t.NameFilm_1 = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 1, 0 }, "");
                        t.NameFilm_2 = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 1, 1 }, "");
                        t.StatusFilm = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 1, 2 }, "");
                        t.Ribbon     = Getnode.GetValueHtmlToChird(item, new int[] { 0, 0, 1, 3 }, "");
                        i.listFilmItem.Add(t);
                    }
                    listFilmHome.Add(i);
                }
                if (listFilmHome.Count == 0)
                {
                    json_FilmHome.status = false;
                }
                else
                {
                    json_FilmHome.status = true;
                }
            }
            catch
            {
                var t = listFilmHome;
                json_FilmHome.status = false;
            }
            return(BaseJsonFilmHome());
        }
Пример #3
0
 internal static string Get_Server(string html)
 {
     server = new Models.Server();
     try
     {
         var node            = Getnode.GetOneTag(html, "div", "class", "list-server");
         var nodeDescription = Getnode.GetOneTag(html, "div", "class", "block-wrapper page-single block-note");
         foreach (var item in nodeDescription.ChildNodes)
         {
             if (item.Name != "#text")
             {
                 continue;
             }
             server.Descripton += Getnode.GetValueHtmlToChird(item, new int[] { }, "") + "\n";
         }
         foreach (var item in node.ChildNodes)
         {
             Models.ListEpiside listEpisode = new Models.ListEpiside();
             listEpisode.Title = Getnode.GetValueHtmlToChird(item, new int[] { 0 }, "");
             var nodeEpisode = Getnode.GetListNodeToNode(item, new int[] { 1 })[0];
             foreach (var itemNode in nodeEpisode.ChildNodes)
             {
                 Models.Episode ep = new Models.Episode();
                 ep.ID    = Getnode.GetValueHtmlToChird(itemNode, new int[] { 0 }, "data-episodeid");
                 ep.Name  = Getnode.GetValueHtmlToChird(itemNode, new int[] {  }, "");
                 ep.Title = Getnode.GetValueHtmlToChird(itemNode, new int[] { 0 }, "title");
                 ep.Url   = Getnode.GetValueHtmlToChird(itemNode, new int[] { 0 }, "href");
                 listEpisode.Episode.Add(ep);
             }
             server.ListEpiside.Add(listEpisode);
         }
         json_Server.status = true;
     }
     catch
     {
         json_Server.status = false;
     }
     return(BaseServer());
 }
Пример #4
0
        internal static string Get_FullDetailFilm(string html)
        {
            List <Models.Actor>    listActor    = Get_ActorFilm(html);
            List <Models.FilmItem> listRelaFilm = Get_RelaFilm(html);

            detailFilm = new Models.DetailFilm();
            try
            {
                var node     = Getnode.GetOneTag(html, "div", "class", "movie-info");
                var nodeInfo = Getnode.GetListNodeToNode(node, new int[] { 0, 0, 0, 1, 0 })[0];

                int limit = node.ChildNodes.Count < 42 ? 42 - nodeInfo.ChildNodes.Count + 1 : 0;
                int l     = 5;

                detailFilm.Thumb       = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 1, 0, 0 }, "src");
                detailFilm.UrlFilm     = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 1, 0, 2, 2, 0 }, "href");
                detailFilm.Description = Getnode.GetValueHtmlToChird(node, new int[] { 3, 2 }, "");
                detailFilm.NameFilm1   = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 0, 0, 0 }, "");
                detailFilm.NameFilm2   = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 0, 0, 1 }, "");
                detailFilm.Status      = Getnode.GetValueHtmlToChird(nodeInfo, new int[] { 1 }, "");
                detailFilm.ImDB        = Getnode.GetValueHtmlToTag(nodeInfo, "class", "movie-dd imdb");
                if (!string.IsNullOrEmpty(detailFilm.ImDB))
                {
                    detailFilm.Votes = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 0, 1, 0, 6 }, "");
                    l = 0;
                }


                detailFilm.Year         = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 0, 1, 0, 15 - l }, "");
                detailFilm.OpenDate     = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 0, 1, 0, 18 - l }, "");
                detailFilm.Time         = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 0, 1, 0, 21 - l }, "");
                detailFilm.TotalEpisode = limit == 0 ? Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 0, 1, 0, 24 - l }, "") : "";
                detailFilm.Quality      = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 0, 1, 0, 30 - limit }, "");
                detailFilm.Language     = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 0, 1, 0, 33 - limit }, "");
                detailFilm.Company      = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 0, 1, 0, 39 - limit }, "");
                detailFilm.View         = Getnode.GetValueHtmlToChird(node, new int[] { 0, 0, 0, 1, 0, 42 - limit }, "");
                detailFilm.Actor        = listActor;
                detailFilm.RelaFilm     = listRelaFilm;

                var nodeDirector = Getnode.GetListNodeToTag(nodeInfo, "class", "movie-dd dd-director");
                foreach (var item in nodeDirector[0].ChildNodes)
                {
                    Models.Director i = new Models.Director();
                    if (item.Name == "#text")
                    {
                        continue;
                    }
                    var value = Getnode.GetValueHtmlToChird(item, new int[] { }, "href");
                    i.UrlDirector  = value;
                    i.DirectorName = Getnode.GetValueHtmlToChird(item, new int[] { }, "");
                    detailFilm.ArrDirector.Add(i);
                }


                var nodeCountry = Getnode.GetListNodeToTag(nodeInfo, "class", "movie-dd dd-country");
                var dCountry    = Common.AddDicCountry();
                foreach (var item in nodeCountry[0].ChildNodes)
                {
                    Models.Country iCountry = new Models.Country();
                    if (item.Name == "#text")
                    {
                        continue;
                    }
                    var value = Getnode.GetValueHtmlToChird(item, new int[] { }, "href");
                    iCountry.NameCountry = Getnode.GetValueHtmlToChird(item, new int[] { }, "");
                    iCountry.EnumCountry = dCountry.FirstOrDefault(t => t.Value == value).Key;
                    detailFilm.ArrCountry.Add(iCountry);
                }


                var nodeGenre = Getnode.GetListNodeToTag(nodeInfo, "class", "movie-dd dd-cat");
                var dGenre    = Common.AddDicGenre();
                foreach (var item in nodeGenre[0].ChildNodes)
                {
                    Models.Genre i = new Models.Genre();
                    if (item.Name == "#text")
                    {
                        continue;
                    }
                    var value = Getnode.GetValueHtmlToChird(item, new int[] { }, "href");
                    i.NameGenre = Getnode.GetValueHtmlToChird(item, new int[] { }, "");
                    i.EnumGenre = dGenre.FirstOrDefault(t => t.Value == value).Key;
                    detailFilm.ArrGenre.Add(i);
                }
                json_DetailFilm.status = true;
            }

            catch
            {
                json_DetailFilm.status = false;
            }
            return(BaseJsonDetail());
        }