Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/MP1-4980-Update_MyVideo_…
Browse files Browse the repository at this point in the history
…grabbers' into MP_1.23.100_Pre_Release_Test4
  • Loading branch information
Azzuro committed Dec 31, 2019
2 parents 07dc672 + 7cfc1c7 commit 1c1f3b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ internal class InternalActorsGrabber : IIMDBInternalActorsScriptGrabber
// Director // Director
string rxDirectorsBlock = @"<h\d[^>]*>[^D]*Director[s]?:[^<]*<\/h\d>[^<]*(?<director>.*?)<\/div>"; string rxDirectorsBlock = @"<h\d[^>]*>[^D]*Director[s]?:[^<]*<\/h\d>[^<]*(?<director>.*?)<\/div>";
string directorsBlock = Regex.Match(_strBody, rxDirectorsBlock, RegexOptions.Singleline | RegexOptions.IgnoreCase).Value; string directorsBlock = Regex.Match(_strBody, rxDirectorsBlock, RegexOptions.Singleline | RegexOptions.IgnoreCase).Value;
// regex = @"href=.\/name\/nm\d{7}(?:\/|\?)[^>]+?>(?:<span[^>]+?>)?(?<director>.*?)(?:<\/span>)?<\/a>"; // regex = @"href=.\/name\/nm\d{7,8}(?:\/|\?)[^>]+?>(?:<span[^>]+?>)?(?<director>.*?)(?:<\/span>)?<\/a>";
regex = @"<span[^>]+?>(?<director>.*?)?<\/span>"; regex = @"<span[^>]+?>(?<director>.*?)?<\/span>";
string director = Regex.Match(directorsBlock, regex, RegexOptions.Singleline | RegexOptions.IgnoreCase).Groups["director"].Value; string director = Regex.Match(directorsBlock, regex, RegexOptions.Singleline | RegexOptions.IgnoreCase).Groups["director"].Value;


Expand Down Expand Up @@ -531,7 +531,7 @@ internal class InternalActorsGrabber : IIMDBInternalActorsScriptGrabber
{ {
foreach (string actor in lstActors) foreach (string actor in lstActors)
{ {
Regex regexActor = new Regex(@"\|(.+)\|(nm\d{7})"); Regex regexActor = new Regex(@"\|(.+)\|(nm\d{7,8})");
Match matchActor = regexActor.Match(actor); Match matchActor = regexActor.Match(actor);
if (match.Success) if (match.Success)
{ {
Expand Down Expand Up @@ -1387,7 +1387,7 @@ internal class InternalActorsGrabber : IIMDBInternalActorsScriptGrabber
string strDirectorImdbId = string.Empty; string strDirectorImdbId = string.Empty;
string strDirectorName = string.Empty; string strDirectorName = string.Empty;
string regexBlockPattern = @"name=.directors?.(?<directors_block>.*?)<h\d"; string regexBlockPattern = @"name=.directors?.(?<directors_block>.*?)<h\d";
string regexPattern = @"<a\s+href=.\/name\/(?<idDirector>nm\d{7})\/.[^>]*>(?<movieDirectors>[^<]+)<\/a>"; string regexPattern = @"<a\s+href=.\/name\/(?<idDirector>nm\d{7,8})\/.[^>]*>(?<movieDirectors>[^<]+)<\/a>";
string regexBlock = Regex.Match(HttpUtility.HtmlDecode(strBodyActors), string regexBlock = Regex.Match(HttpUtility.HtmlDecode(strBodyActors),
regexBlockPattern, RegexOptions.Singleline).Groups["directors_block"].Value; regexBlockPattern, RegexOptions.Singleline).Groups["directors_block"].Value;
strDirectorImdbId = Regex.Match(regexBlock, regexPattern, RegexOptions.Singleline).Groups["idDirector"].Value; strDirectorImdbId = Regex.Match(regexBlock, regexPattern, RegexOptions.Singleline).Groups["idDirector"].Value;
Expand All @@ -1404,7 +1404,7 @@ internal class InternalActorsGrabber : IIMDBInternalActorsScriptGrabber
regexBlock = Regex.Match(HttpUtility.HtmlDecode(strBodyActors), regexBlock = Regex.Match(HttpUtility.HtmlDecode(strBodyActors),
regexBlockPattern, RegexOptions.Singleline).Groups["writers_block"].Value; regexBlockPattern, RegexOptions.Singleline).Groups["writers_block"].Value;


regexPattern = @"href=.\/name\/(?<imdbWriterId>nm\d{7})\/[^>]*>(?<writer>[^<]+)<\/a>[^(]*(?<wrole>[^)]*\))|href=.\/name\/(?<imdbWriterId>nm\d{7})\/[^>]*>(?<writer>[^<]+)<\/a>(?<wrole>)"; regexPattern = @"href=.\/name\/(?<imdbWriterId>nm\d{7,8})\/[^>]*>(?<writer>[^<]+)<\/a>[^(]*(?<wrole>[^)]*\))|href=.\/name\/(?<imdbWriterId>nm\d{7,8})\/[^>]*>(?<writer>[^<]+)<\/a>(?<wrole>)";
MatchCollection mc = Regex.Matches(regexBlock, regexPattern); MatchCollection mc = Regex.Matches(regexBlock, regexPattern);


if (mc.Count != 0) if (mc.Count != 0)
Expand Down Expand Up @@ -1462,8 +1462,8 @@ internal class InternalActorsGrabber : IIMDBInternalActorsScriptGrabber


// cast // cast
regexBlockPattern = @"<table class=.cast(?:_list)?"">.*?<\/table>"; regexBlockPattern = @"<table class=.cast(?:_list)?"">.*?<\/table>";
// regexPattern = @"<td[^<]*<a\s+href=.\/name\/(?<imdbActorID>nm\d{7})\/[^>]*?>[\s\S]+?itemprop=.name.>(?<actor>[^<]*)<\/span>[\s\S]+?<td.class=.char(?:acter)?.>(?<role>.+?)<*?<\/td>"; // regexPattern = @"<td[^<]*<a\s+href=.\/name\/(?<imdbActorID>nm\d{7,8})\/[^>]*?>[\s\S]+?itemprop=.name.>(?<actor>[^<]*)<\/span>[\s\S]+?<td.class=.char(?:acter)?.>(?<role>.+?)<*?<\/td>";
regexPattern = @"<td[^<]*itemprop=""actor""[^<]*<a\s+href=""\/name\/(?<imdbActorID>nm\d{7})\/[^>]*>[^<]*?<span[^>]*?>(?<actor>[^<]*)<\/span>.*?<td.class=""character"">(?<role>.*?)<*?<\/td>"; regexPattern = @"<td[^<]*itemprop=""actor""[^<]*<a\s+href=""\/name\/(?<imdbActorID>nm\d{7,8})\/[^>]*>[^<]*?<span[^>]*?>(?<actor>[^<]*)<\/span>.*?<td.class=""character"">(?<role>.*?)<*?<\/td>";
Match castBlock = Regex.Match(strBodyActors, regexBlockPattern, RegexOptions.Singleline); Match castBlock = Regex.Match(strBodyActors, regexBlockPattern, RegexOptions.Singleline);
string strCastBlock = HttpUtility.HtmlDecode(castBlock.Value); string strCastBlock = HttpUtility.HtmlDecode(castBlock.Value);


Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ internal class MovieImagesGrabber : InternalCSScriptGrabbersLoader.Movies.IInter
wc.Dispose(); wc.Dispose();
} }
// Check if IMDB number on poster page is equal to IMDB ttnumber, if not-> next link // Check if IMDB number on poster page is equal to IMDB ttnumber, if not-> next link
Match ttcheck = Regex.Match(resultImpAw, @"tt\d{7}"); Match ttcheck = Regex.Match(resultImpAw, @"tt\d{7,8}");


if (ttcheck.Value != imdbMovieID) if (ttcheck.Value != imdbMovieID)
{ {
Expand Down

0 comments on commit 1c1f3b0

Please sign in to comment.