/// <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 match = YRegex.MatchesToList( "<a href=\"/country/.{0,30}?\">(?<country>.*?)</a>", this.GetHtml("main", threadID, id), "country", true); foreach (var country in match) { if (Equals(country, "UK")) { output.Add("United Kingdom"); } else if (!country.ToLower(CultureInfo.CurrentCulture).Contains("imdb")) { output.Add(Tools.Clean.Text.ValidizeResult(country)); } } return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the poster image collection. /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped poster image collection.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapePoster(string id, int threadID, out BindingList <ImageDetailsModel> output, string logCatagory) { output = new BindingList <ImageDetailsModel>(); try { var images = YRegex.MatchesToList( @"<a\sonclick=""loadBigImage\('(?<url>/functions/download\.php\?id=\d[0-9].*?)'", this.GetHtml("main", threadID, id), "url"); foreach (var s in images) { output.Add(new ImageDetailsModel { UriFull = new Uri("http://www.filmdelta.se" + s) }); } return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the studio value /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped studio value.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeStudio(string id, int threadID, out BindingList <string> output, string logCatagory) { output = new BindingList <string>(); try { output = YRegex.MatchesToList( "dystrybucja:</dt><dd> (?<studio>.*?) </dd>", this.GetHtml("main", threadID, id), "studio"); 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 html = this.GetHtml("main", threadID, id); output = YRegex.MatchesToList("Kat=Land&Text=(?<country>.*?)\"", html, "country", true); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Genre collection /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Year collection.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeGenre(string id, int threadID, out BindingList <string> output, string logCatagory) { output = new BindingList <string>(); try { output = YRegex.MatchesToList( @"<a href=""/search/film\?genreIds=\d{1,2}"">(?<genre>.*?)</a", this.GetHtml("main", threadID, id), "genre", true); 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 { output = YRegex.MatchesToList( @"страна</td><td\sclass=""""><a\shref="".*?"">(?<country>.*?)</a>", this.GetHtml("main", threadID, id), "country"); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Genre collection /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Year collection.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeGenre(string id, int threadID, out BindingList <string> output, string logCatagory) { output = new BindingList <string>(); try { output = YRegex.MatchesToList( @"gatunek:.*?<a.*?>\s(?<genre>.*?)</a>", this.GetHtml("main", threadID, id), "genre", true); 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 { output = YRegex.MatchesToList( @"produkcja:(?<countries>.*?)gatunek", this.GetHtml("main", threadID, id), "countries", true); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Genre collection /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Year collection.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeGenre(string id, int threadID, out BindingList <string> output, string logCatagory) { output = new BindingList <string>(); try { output = YRegex.MatchesToList( @"<a\shref=""/film/tous/genre-\d{5}/"">(?<genre>.*?)</a>", this.GetHtml("main", threadID, id), "genre"); return(true); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Genre collection /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Year collection.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeGenre(string id, int threadID, out BindingList <string> output, string logCatagory) { output = new BindingList <string>(); try { output = YRegex.MatchesToList( @"<h5><a\shref='/search\.php\?string=.*?&type=category'>(?<genre>.*?)\s</a></h5>", this.GetHtml("main", threadID, id), "genre", true); 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 { output = YRegex.MatchesToList( @"<img\ssrc=""/imgs/countries/.*?.jpg""\stitle=""(?<country>.*?)""\sborder=""0""\salign=""middle""", this.GetHtml("main", threadID, id), "country", true); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Genre collection /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Year collection.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeGenre(string id, int threadID, out BindingList <string> output, string logCatagory) { output = new BindingList <string>(); try { output = YRegex.MatchesToList( "<a href=\"/Sections/Genres/(?<genre>[a-zA-Z-]*)(/\">|\">)", this.GetHtml("main", threadID, id), "genre", true); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Language collection /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Language collection.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeLanguage(string id, int threadID, out BindingList <string> output, string logCatagory) { output = new BindingList <string>(); try { output = YRegex.MatchesToList( "<a href=\"/language/.{2,3}\">(?<language>.*?)</a>", this.GetHtml("main", threadID, id), "language", true); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the Genre collection /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped Year collection.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapeGenre(string id, int threadID, out BindingList <string> output, string logCatagory) { output = new BindingList <string>(); try { var html = this.GetHtml("main", threadID, id); output = YRegex.MatchesToList( "genre=.*?&attr=rat_count\" style=\"text-decoration:none\">(?<genre>.*?)</a>", html, "genre"); return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }
/// <summary> /// Scrapes the poster image collection. /// </summary> /// <param name="id">The MovieUniqueId for the scraper.</param> /// <param name="threadID">The thread MovieUniqueId.</param> /// <param name="output">The scraped poster image collection.</param> /// <param name="logCatagory">The log catagory.</param> /// <returns>Scrape succeeded [true/false]</returns> public new bool ScrapePoster(string id, int threadID, out BindingList <ImageDetailsModel> output, string logCatagory) { output = new BindingList <ImageDetailsModel>(); try { foreach (var type in new[] { "product", "poster" }) { var individualPosterHtml = Downloader.ProcessDownload( string.Format("http://www.imdb.com/title/{0}/mediaindex?refine={1}", id, type), DownloadType.Html, Section.Movies).RemoveCharacterReturn(); var matches = YRegex.MatchesToList( @"(?<url>/rg/mediaindex/unknown-thumbnail/media/rm\d{10}/tt\d{7})", individualPosterHtml, "url"); foreach (var m in matches) { if (!m.Contains("swf")) { var newHtml = Downloader.ProcessDownload(string.Format("http://www.imdb.com{0}", m), DownloadType.Html, Section.Movies).RemoveCharacterReturn(); var match = Regex.Match( newHtml, @"src=""(?<url>http://ia\.media-imdb\.com/images/M/(?<str>[A-Za-z0-9_]+?)@@\._V1\._SX(?<width>\d{3})_SY(?<height>\d{3})_\.jpg)""\s"); if (match.Success) { var matchValue = match.Groups["url"].Value; int width; int height; int.TryParse(match.Groups["width"].Value, out width); int.TryParse(match.Groups["height"].Value, out height); if (height > width) { if (!string.IsNullOrEmpty(matchValue)) { output.Add( new ImageDetailsModel { Height = height, Width = width, UriFull = new Uri(matchValue) }); } } } } } } return(output.IsFilled()); } catch (Exception ex) { Log.WriteToLog(LogSeverity.Error, threadID, logCatagory, ex.Message); return(false); } }