/// <summary> /// Scrapes the Director value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Director value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeDirector(string id, int threadID, out BindingList <PersonModel> output, string logCatagory) { output = new BindingList <PersonModel>(); try { var directors = YRegex.Match( @"Directed By (?<director>.*?)\.", this.GetHtml("main", threadID, id), "director", true); directors = Tools.Clean.Text.ValidizeResult(directors); output = directors .Split(',') .ToPersonList(); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Cast collection. /// </summary> /// <param name="id">The Id for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Cast value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeCast(string id, int threadID, out BindingList <PersonModel> output, string logCatagory) { output = new BindingList <PersonModel>(); try { var html = this.GetHtml("cast", threadID, id); var castBlockHtml = YRegex.Match(@"Darsteller(?<castblock>.*?)Drehbuchautor", html, "castblock"); output = YRegex.MatchesToPersonList( @"src=""thumbnail\.php\?cover=(?<image>.*?)&size=6"".*?<b>(?<name>.*?)</b>.*?\.\.\.(?<role>.*?)</font></td>", castBlockHtml, "name", "role", "image"); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Searches the sites search engine for movies. /// </summary> /// <param name="query">The query.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>[true/false] if an error occurred.</returns> public new bool SearchSite(Query query, int threadID, string logCatagory) { try { var url = string.Format( "http://www.filmweb.pl/szukaj?q={0}&type=&startYear={1}&endYear={1}&startRate=&endRate=&startCount=&endCount=&sort=TEXT_SCORE&sortAscending=false", query.Title.Replace(' ', '+'), query.Year); var downloadHtml = Downloader.ProcessDownload(url, DownloadType.Html, Section.Movies).RemoveCharacterReturn(); query.Results.Add( new QueryResult { URL = YRegex.Match(@"searchResultTitle""\shref=""(?<url>.*?)"">.*?</a>", downloadHtml, "url") }); return(true); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Cast collection. /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Cast value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeCast(string id, int threadID, out BindingList <PersonModel> output, string logCatagory) { output = new BindingList <PersonModel>(); try { var htmlBlock = YRegex.Match( @"<th scope=""col"">Bohater</th>(?<actorblock>.*?)zobacz więcej", this.GetHtml("main", threadID, id), "actorblock"); htmlBlock = Regex.Replace(htmlBlock.Replace("\t", string.Empty), @"\s{2,}", " "); output = YRegex.MatchesToPersonList( @"<img.*?rc=""(?<thumb>.*?)""\stitle="".*?""\salt=.*?>\s(?<name>.*?)</a></td>\s<td.*?>\s(?<role>.*?)\s<s.*?</tr>", htmlBlock, "name", "role", "thumb"); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the tagline value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped tagline value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeTagline(string id, int threadID, out string output, string logCatagory) { output = string.Empty; try { output = YRegex.Match( @"<h5>Tagline:</h5><div\sclass=""info-content"">(?<tagline>.*?)</div>", this.GetHtml("main", threadID, id), "tagline", true); if (output.EndsWith(" more")) { output.TrimEnd(" more".ToCharArray()); } output = output.Replace("See more »", string.Empty); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Certification value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Certification value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeCertification(string id, int threadID, out string output, string logCatagory) { output = string.Empty; try { var cert = YRegex.Match(@"<h5>Certification:</h5>(?<cert>.*?)</div>", this.GetHtml("main", threadID, id), "cert", true); var matches = Regex.Matches(cert, @"USA:(?<mpaa>.*?)\s|USA:(?<mpaa>.*?)$", RegexOptions.IgnoreCase); foreach (Match match in matches) { if (!match.Groups["mpaa"].Value.Contains("TV")) { output = string.Format("{0}", match.Groups["mpaa"].Value); break; } } return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Country copllection /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Country collection.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeCountry(string id, int threadID, out BindingList <string> output, string logCatagory) { output = new BindingList <string>(); try { var country = YRegex.Match( @"Long-métrage<a\sclass=""underline""\shref="".*?"">(?<country>.*?)</a><span>", this.GetHtml("main", threadID, id), "country", true); if (!string.IsNullOrEmpty(country)) { output.Add(country); } return(true); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Plot value /// </summary> /// <param name="id">The ID for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Plot value.</param> /// <param name="logCatagory">The log catagory.</param> /// <param name="returnShort">if set to <c>true</c> short plot is returned if available.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapePlot(string id, int threadID, out string output, string logCatagory, bool returnShort) { output = string.Empty; try { if (returnShort) { output = YRegex.Match(@"<h5>Plot:</h5>(?<plot>.*?)</div>", this.GetHtml("main", threadID, id), "plot", true); } else { var plot = YRegex.Match( @"<p class=""plotpar"">(?<plot>.*?)<i>", this.GetHtml("plot", threadID, id), "plot", true); if (!string.IsNullOrEmpty(plot)) { output = plot.Trim(); } else if (!string.IsNullOrEmpty(plot)) { output = YRegex.Match( @"<div id=""swiki.2.1"">(?<synopsis>.*?)</div>", this.GetHtml("summary", threadID, id), "synopsis", true) .Trim(); } else { this.ScrapePlot(id, threadID, out output, logCatagory, true); } } output = output.Replace( new[] { "Add synopsis »", "Full synopsis »", "Full summary »", "See more »" }, string.Empty); output = Tools.Clean.Text.ValidizeResult(output); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Title value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Title value.</param> /// <param name="alternatives">Alternative namings found for a title.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeTitle(string id, int threadID, out string output, out BindingList <string> alternatives, string logCatagory) { output = string.Empty; alternatives = new BindingList <string>(); try { var html = this.GetHtml("main", threadID, id); var releaseInfoHtml = this.GetHtml("releaseinfo", threadID, id); output = YRegex.Match("(<title>)(.*)( [(].*</title>)", html, 2, true); var titleAltHtml = YRegex.Match( @"\(AKA\)</a></h5><table\sborder=""0""\scellpadding=""2"">(?<html>.*?)</tr></table>", releaseInfoHtml, "html"); var altTitles = YRegex.Matches( @"<td>(?<name>.*?)</td><td>(?<details>.*?)</td>", titleAltHtml, "name", "details", true); alternatives.AddRange(from s in altTitles where !s.Value.ToLower().Contains(new[] { "imax ", "working ", "fake " }) select s.Key); if (html.Contains("title-extra")) { var origTitle = YRegex.Match( @"class=""title-extra"">(?<title>.*?) <i>\(original title\)</i>", html, "title"); if (origTitle.Trim().Length > 0) { output = origTitle; } } output = Regex.Replace(output, @"\(\d{4}\)", string.Empty); output = Tools.Clean.Text.ValidizeResult(output); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Plot value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Plot value.</param> /// <param name="logCatagory">The log catagory.</param> /// <param name="returnShort">if set to <c>true</c> short plot is returned if available.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapePlot(string id, int threadID, out string output, string logCatagory, bool returnShort) { output = string.Empty; try { output = YRegex.Match("SINOPSIS(?<plot>.*?)</tr>", this.GetHtml("main", threadID, id), "plot", true) .ReplaceWithStringEmpty(new[] { "SINOPSIS:", "(FILMAFFINITY)" }); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Original Title value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Original Title value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeOriginalTitle(string id, int threadID, out string output, string logCatagory) { output = string.Empty; try { output = YRegex.Match( @"<td ><b>(?<Originaltitle>.*?)</b></td>", this.GetHtml("main", threadID, id), "Originaltitle"); return(output != string.Empty); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// The disk part number. /// </summary> /// <param name="fileName"> /// The file name. /// </param> /// <returns> /// The part number. /// </returns> public static int GetPartNumber(string fileName) { int result = 0; Match regexResult = Regex.Match( fileName, @"(CD\d{1,10})|(CD\s\d{1,10})|(PART\d{1,10})|(PART\s\d{1,10})|(DISC\d{1,10})|(DISC\s\d{1,10})|(DISK\d{1,10})|(DISK\s\d{1,10})", RegexOptions.IgnoreCase); if (regexResult.Success) { string val = regexResult.Value; string stringInt = YRegex.Match(@"(?<value>\d{1,3})", val, "value"); int.TryParse(stringInt, out result); } return(result); }
/// <summary> /// Scrapes the Top250 value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Top250 value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeTop250(string id, int threadID, out int output, string logCatagory) { output = -1; try { output = YRegex.Match( @"top\sświat:\s(?<top250>\d*)", this.GetHtml("main", threadID, id), "genre") .ToInt(); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Year value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Year value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeYear(string id, int threadID, out int output, string logCatagory) { output = -1; try { output = YRegex.Match( @"<title>(?<title>.*?)\s\((?<year>.*?)\)\s\s-\sFilm", this.GetHtml("main", threadID, id), "title").ToInt(); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Origional Title value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Origional Title value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeOrigionalTitle(string id, int threadID, out string output, string logCatagory) { output = string.Empty; try { output = YRegex.Match( @">Titolo\so.*?e:.*?=""2"">(?<origionaltitle>.*?)</f", this.GetHtml("main", threadID, id), "title"); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Year value /// </summary> /// <param name="id">The Id for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Year value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns> /// Scrape succeeded [true/false] /// </returns> public new bool ScrapeYear(string id, int threadID, out int output, string logCatagory) { output = 0; try { var html = this.GetHtml("main", threadID, id); output = YRegex.Match(@"<title>OFDb\s-\s(?<title>.*?)\s\((?<year>\d{4})\)</title>", html, "year", true) .ToInt(); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Rating value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Reting value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeRating(string id, int threadID, out double output, string logCatagory) { output = -1; try { output = YRegex.Match( @"font-weight:\sbold;"">(?<rating>\d,\d)</td>", this.GetHtml("main", threadID, id), "rating").ToDouble(); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the runtime value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped runtime value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeRuntime(string id, int threadID, out int output, string logCatagory) { output = -1; try { output = YRegex.Match( @"<div\sclass=time>(?<runtime>.*?)<span>", this.GetHtml("main", threadID, id), "runtime") .ToInt(); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Top250 value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Top250 value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeTop250(string id, int threadID, out int output, string logCatagory) { output = -1; try { output = YRegex.Match( @"<span class=worldRanking>(?<top250>\d{1,3}).", this.GetHtml("main", threadID, id), "top250") .ToInt(); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the votes value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped votes value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeVotes(string id, int threadID, out int output, string logCatagory) { output = -1; try { output = YRegex.Match( @"głosów:.*?>(?<votes>\d.*?)<", this.GetHtml("main", threadID, id), "votes") .ToInt(); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Original Title value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Original Title value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeOriginalTitle(string id, int threadID, out string output, string logCatagory) { output = string.Empty; try { output = YRegex.Match( @"<title>(?<title>.*?)\s/\s(?<originaltitle>.*?)\s\((?<year>\d{4})\)", this.GetHtml("main", threadID, id), "originaltitle"); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Plot value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Plot value.</param> /// <param name="logCatagory">The log catagory.</param> /// <param name="returnShort">if set to <c>true</c> short plot is returned if available.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapePlot(string id, int threadID, out string output, string logCatagory, bool returnShort) { output = string.Empty; try { output = YRegex.Match( "<span class=filmDescrBg property=\"v:summary\">(?<plot>.*?)</span>", this.GetHtml("main", threadID, id), "plot", true); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Plot value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Plot value.</param> /// <param name="logCatagory">The log catagory.</param> /// <param name="returnShort">if set to <c>true</c> short plot is returned if available.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapePlot(string id, int threadID, out string output, string logCatagory, bool returnShort) { output = string.Empty; try { output = YRegex.Match( @"<span\sclass=""_reachbanner_"">(?<plot>.*?)</span>", this.GetHtml("main", threadID, id), "plot"); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Original Title value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Original Title value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeOriginalTitle(string id, int threadID, out string output, string logCatagory) { output = string.Empty; try { output = YRegex.Match( @"<span\sstyle=""color:\s#666;\sfont-size:\s13px"">(?<Originaltitle>.*?)</span>", this.GetHtml("main", threadID, id), "Originaltitle"); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Original Title value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Original Title value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeOriginalTitle(string id, int threadID, out string output, string logCatagory) { output = string.Empty; try { output = YRegex.Match( @"<h4>Originaltitel</h4>\s*<h5>(?<Originaltitle>.*?)</h5>", this.GetHtml("html", threadID, id), "Originaltitle", true); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the runtime value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped runtime value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeRuntime(string id, int threadID, out int output, string logCatagory) { output = -1; try { output = YRegex.Match( @"время</td><td\sclass=""time""\sid=""runtime"">(?<runtime>\d*?)\sмин", this.GetHtml("main", threadID, id), "runtime") .ToInt(); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Rating value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Reting value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeRating(string id, int threadID, out double output, string logCatagory) { output = -1; try { output = YRegex.Match( @"text-decoration:\snone"">(?<rating>.*?)<span\sstyle=""font:100", this.GetHtml("main", threadID, id), "rating") .ToDouble(); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Year value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Year value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeYear(string id, int threadID, out int output, string logCatagory) { output = -1; try { output = YRegex.Match( @""">(?<year>\d{4})</a></td></tr>", this.GetHtml("main", threadID, id), "year") .ToInt(); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Title value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread ID.</param> /// <param name="output">The scraped Title value.</param> /// <param name="alternatives">Alternative namings found for a title.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeTitle(string id, int threadID, out string output, out BindingList <string> alternatives, string logCatagory) { output = string.Empty; alternatives = new BindingList <string>(); try { output = YRegex.Match( "<title>(?<title>.*?)</title>", this.GetHtml("main", threadID, id), "title"); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Cast collection. /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Cast value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeCast(string id, int threadID, out BindingList <PersonModel> output, string logCatagory) { output = new BindingList <PersonModel>(); try { output = YRegex.Match( "REPARTO</b></td>(?<cast>.*?)PRODUCTORA", "cast", "cast", true).ToPersonList(); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }