Пример #1
0
        private string GetPlot(string page)
        {
            string _res = BaseCollector.GetItem(page, m_CountryFactory.RE_Plot + "</h2>.*?<p>(?<Plot>[^<]+)", "Plot", RegexOptions.Singleline | RegexOptions.IgnoreCase);

            if (!string.IsNullOrEmpty(_res))
            {
                return(_res);
            }
            else
            {
                Match match = new Regex(string.Format("<h5>{0}</h5>.*?info-content\">(.*?)</div>", m_CountryFactory.RE_Plot), RegexOptions.Multiline | RegexOptions.IgnoreCase).Match(page.Replace("\n", ""));
                if (match.Success)
                {
                    string _result = HttpUtility.HtmlDecode(Regex.Replace(match.Groups[1].Value, "<a class.*?</a>", "")).Trim().TrimEnd(new char[] { '|' }).TrimEnd(new char[0]);
                    _result = Regex.Replace(_result, "<a href=\"/title.*?</a>", "");
                    int _start = _result.LastIndexOf(".");
                    if (_start >= 0)
                    {
                        try
                        {
                            _result = _result.Substring(0, _start + 1);
                        }
                        catch { }
                    }
                    return(_result);
                }

                return(string.Empty);
            }
        }
Пример #2
0
        private string GetMetascore(string page)
        {
            string _res = BaseCollector.GetItem(page, @"Metascore: <a href=""criticreviews\?ref_=tt_ov_rt"" title=""(?<Metascore>\d+)\s", "Metascore", RegexOptions.Singleline).Trim();

            if (!string.IsNullOrEmpty(_res))
            {
                return(_res);
            }
            return(string.Empty);
        }
Пример #3
0
        private string GetTrailerLink(string page)
        {
            string _res = BaseCollector.GetItem(page, @"<a href=""(?<Trailer>/video/imdb/vi\d+/\?ref_=tt_ov_vi)"" class=""btn2 btn2_text_on large title-trailer", "Trailer");

            if (!string.IsNullOrEmpty(_res))
            {
                return(_res);
            }
            else
            {
                return(string.Empty);
            }
        }
Пример #4
0
        private string GetYear(string page)
        {
            string _res = BaseCollector.GetItem(page, @"<title>[^\(]+\((?<Year>\d{4})|<title>[^\(]+\(.*?(?<Year>\d{4})", "Year");

            if (!string.IsNullOrEmpty(_res))
            {
                return(_res);
            }
            else
            {
                Match match = new Regex(@"<title>.*?\s\((\d{4})", RegexOptions.Multiline | RegexOptions.IgnoreCase).Match(page);
                if (match.Success)
                {
                    return(match.Groups[1].Value);
                }
                return(string.Empty);
            }
        }
Пример #5
0
        private string GetOriginalTitle(string page)
        {
            string _res = BaseCollector.GetItem(page, "class=\"title-extra\">(?<OriginalTitle>[^<^\\(]+)", "OriginalTitle").Trim().Trim(new char[] { '"' });

            if (!string.IsNullOrEmpty(_res))
            {
                return(_res);
            }
            else
            {
                Match match = new Regex("class=\"title-extra\">(?<OriginalTitle>[^<^\\(]+)", RegexOptions.Singleline | RegexOptions.IgnoreCase).Match(page);
                if (match.Success)
                {
                    return(HttpUtility.HtmlDecode(match.Groups["OriginalTitle"].Value.Trim()).Trim(new char[] { '"' }));
                }
                return(string.Empty);
            }
        }
Пример #6
0
        private string GetTitle(string page)
        {
            string _res = BaseCollector.GetItem(page, @"<title>(?<Title>[^\(]+)", "Title").Trim().Trim(new char[] { '"' }).Replace("IMDb - ", "");

            if (!string.IsNullOrEmpty(_res))
            {
                return(_res);
            }
            else
            {
                Match match = new Regex(@"<title>(.*?)\s\(\d{4}", RegexOptions.Multiline | RegexOptions.IgnoreCase).Match(page);
                if (match.Success)
                {
                    return(HttpUtility.HtmlDecode(match.Groups[1].Value.Trim()).Trim(new char[] { '"' }));
                }
                return(string.Empty);
            }
        }
Пример #7
0
        private string GetMPAA(string page)
        {
            string _res = BaseCollector.GetItem(page, "contentRating\">(?<MPAA>[^<]+)<", "MPAA").Trim().Replace("\r", "").Replace("\n", "").Trim();

            if (!string.IsNullOrEmpty(_res))
            {
                return(_res);
            }
            else
            {
                Match match = new Regex("MPAA</a>:</h5>[\\r\\n]*<div class=\"info-content\">([^<]+)</div", RegexOptions.Singleline | RegexOptions.IgnoreCase).Match(page);
                if (match.Success)
                {
                    return(HttpUtility.HtmlDecode(match.Groups[1].Value.Replace("\r", "").Replace("\n", "").Trim()));
                }
                return(string.Empty);
            }
        }
Пример #8
0
        private string GetTagline(string page)
        {
            string _res = BaseCollector.GetItem(page, "Taglines:</h4>.*?(?<Tagline>[^<]+)<", "Tagline").Trim().Replace("\r", "").Replace("\n", "").Trim();

            if (!string.IsNullOrEmpty(_res))
            {
                return(_res);
            }
            else
            {
                Match match = new Regex("Tagline:</h5>.*?info-content\">(.*?)<", RegexOptions.Singleline | RegexOptions.IgnoreCase).Match(page);
                if (match.Success)
                {
                    return(HttpUtility.HtmlDecode(match.Groups[1].Value.Replace("\r", "").Replace("\n", "").Trim()));
                }
                return(string.Empty);
            }
        }
Пример #9
0
        private string GetReleaseDateFast(string page)
        {
            string _res = BaseCollector.GetItem(page, m_CountryFactory.RE_ReleaseDateFast + @"</h4>.*?(?<ReleaseDate>[^\(]*)", "ReleaseDate");

            if (!string.IsNullOrEmpty(_res))
            {
                return(_res);
            }
            else
            {
                Match match = new Regex(m_CountryFactory.RE_ReleaseDateFast + @"</h5>.*\n.*\n([^\(]*)", RegexOptions.Multiline | RegexOptions.IgnoreCase).Match(page);
                if (match.Success)
                {
                    return(match.Groups[1].Value);
                }
                return(string.Empty);
            }
        }
Пример #10
0
        private string GetRating(string page)
        {
            string _res = BaseCollector.GetItem(page, @"itemprop=""ratingValue"">(?<Rating>[\d\.]+)</span></strong><span class=""mellow"">/<span itemprop=""bestRating"">10", "Rating");

            if (!string.IsNullOrEmpty(_res))
            {
                return(_res);
            }
            else
            {
                Match match = new Regex(@"<b>(\d.*?)/10</b>", RegexOptions.Multiline | RegexOptions.IgnoreCase).Match(page);
                if (match.Success)
                {
                    return(match.Groups[1].Value);
                }
                return(string.Empty);
            }
        }
Пример #11
0
        private string GetRunTime(string page)
        {
            string _res = BaseCollector.GetItem(page, "(?<Runtime>\\d{1,3})\\smin", "Runtime");

            if (!string.IsNullOrEmpty(_res))
            {
                return(_res);
            }
            else
            {
                Match match = new Regex(@"(\d{1,3})\smin", RegexOptions.Multiline | RegexOptions.IgnoreCase).Match(page);
                if (match.Success)
                {
                    return(match.Groups[1].Value);
                }
                return(string.Empty);
            }
        }