Hi
Current script can't grab Country or Lanquage.
Attached version works
// Country
regexBlockPattern = @"<h4\sclass=""inline"">Country:</h4>.*?<h4";
regexPattern = @"'url'>(?<country>.*?)</a>";
block = Regex.Match(strBody, regexBlockPattern, RegexOptions.Singleline).Value.Replace("\n", string.Empty);
MatchCollection mcCountry = Regex.Matches(block, regexPattern, RegexOptions.Singleline);
string country = string.Empty;
foreach (Match ms in mcCountry)
{
country = country + ms.Groups["country"].Value + " / ";
}
try
{
if (!string.IsNullOrEmpty(country))
{
movieDetails.Country = country.Remove(country.LastIndexOf(" / "));
}
}
catch (Exception ex)
{
MediaPortal.GUI.Library.Log.Error("IMDB Script GetCountry error: {0}", ex.Message);
}
// Language
regexPattern = @"<h4\sclass=""inline"">Language:</h4>.*?url'>(?<language>.*?)</a>";
string language = Regex.Match(strBody, regexPattern, RegexOptions.Singleline).Groups["language"].Value;
movieDetails.Language = language;
Current script can't grab Country or Lanquage.
Attached version works
// Country
regexBlockPattern = @"<h4\sclass=""inline"">Country:</h4>.*?<h4";
regexPattern = @"'url'>(?<country>.*?)</a>";
block = Regex.Match(strBody, regexBlockPattern, RegexOptions.Singleline).Value.Replace("\n", string.Empty);
MatchCollection mcCountry = Regex.Matches(block, regexPattern, RegexOptions.Singleline);
string country = string.Empty;
foreach (Match ms in mcCountry)
{
country = country + ms.Groups["country"].Value + " / ";
}
try
{
if (!string.IsNullOrEmpty(country))
{
movieDetails.Country = country.Remove(country.LastIndexOf(" / "));
}
}
catch (Exception ex)
{
MediaPortal.GUI.Library.Log.Error("IMDB Script GetCountry error: {0}", ex.Message);
}
// Language
regexPattern = @"<h4\sclass=""inline"">Language:</h4>.*?url'>(?<language>.*?)</a>";
string language = Regex.Match(strBody, regexPattern, RegexOptions.Singleline).Groups["language"].Value;
movieDetails.Language = language;