Esempio n. 1
0
        public override movie getMovie(HtmlNode victimDetailContent)
        {
            HtmlNodeCollection dd = victimDetailContent.SelectNodes("//ul[@class='meta-data'] //li");
            var currentMovieInfo  = dd[0].SelectSingleNode("./strong").InnerText.Trim().ToLower().Replace("bản đẹp", "HD").ToLower();
            var title             = UnicodeUtil.replaceSpecialCharacter(victimDetailContent.SelectSingleNode("//div[@class='left-content'] //h1[@class='name']").InnerText.Trim());
            var secondTitle       = UnicodeUtil.replaceSpecialCharacter(victimDetailContent.SelectSingleNode("//div[@class='left-content'] //h2[@class='real-name']").InnerText.Trim());
            var alias             = UnicodeUtil.convertToAlias(title + ((secondTitle != "") ? ("-" + secondTitle) : ""));
            int isMultipleEpisode = (currentMovieInfo.IndexOf("tập") != -1 || currentMovieInfo.IndexOf("/") != -1) ? 1 : 0;
            var publishYear       = 0;

            try {
                publishYear = Int32.Parse(dd[dd.Count - 4].SelectSingleNode("./span").InnerText.Trim().Replace("Năm xuất bản:", "").Trim());
            } catch (Exception ex) { Console.Write(ex.Message); }

            movie newMovie = new movie()
            {
                name1           = title,
                name2           = secondTitle,
                alias           = alias,
                isMultiEpisode  = isMultipleEpisode,
                dateUpdate      = DateTime.Now,
                publishYear     = publishYear,
                name1CheckField = buildNameCheckField(title),
                name2CheckField = buildNameCheckField(secondTitle),
                isPublic        = 1
            };

            return(newMovie);
        }
Esempio n. 2
0
        public override movie getMovie(HtmlNode victimDetailContent)
        {
            var dd = getDDItems();
            var currentMovieInfo  = dd[0].InnerText.Trim().ToLower().Replace("bản đẹp", "HD").ToLower();
            var title             = UnicodeUtil.replaceSpecialCharacter(victimDetailContent.SelectSingleNode("//a[@class='title-1']").InnerText.Trim());
            var secondTitle       = UnicodeUtil.replaceSpecialCharacter(victimDetailContent.SelectSingleNode("//span[@class='title-2']").InnerText.Trim());
            var alias             = UnicodeUtil.convertToAlias(title + ((secondTitle != "") ? ("-" + secondTitle) : ""));
            int isMultipleEpisode = (currentMovieInfo.IndexOf("tập") != -1 || currentMovieInfo.IndexOf("/") != -1) ? 1 : 0;
            var publishYear       = 0;

            try { publishYear = Int32.Parse(dd[3].InnerText.Trim()); } catch (Exception ex) { Console.Write(ex.Message); }

            movie newMovie = new movie()
            {
                name1           = title,
                name2           = secondTitle,
                alias           = alias,
                isMultiEpisode  = isMultipleEpisode,
                dateUpdate      = DateTime.Now,
                publishYear     = publishYear,
                name1CheckField = buildNameCheckField(title),
                name2CheckField = buildNameCheckField(secondTitle),
                isPublic        = 1
            };

            return(newMovie);
        }