"IMDB_MP13x - missing Country and Language (1 Viewer)

hkjensen

MP Donator
  • Premium Supporter
  • June 11, 2007
    165
    65
    Copenhagen
    Home Country
    Denmark Denmark
    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;
     

    Attachments

    • IMDB_MP13x.zip
      6.4 KB

    hkjensen

    MP Donator
  • Premium Supporter
  • June 11, 2007
    165
    65
    Copenhagen
    Home Country
    Denmark Denmark
    Hi
    Attached script works

    Changed regex to
    // Plot short
    regexPattern = @"class=""summary_text""\sitemprop=""description"">(?<moviePlotShort>.*?)</div>";

    Changed regex for Plot Long

    regexPattern = @"data-target=""summary-.+?"">(?<moviePlot>.+?)<br\s/>";
    movieDetails.Plot = Regex.Match(strPlotHtml, regexPattern,
    RegexOptions.IgnoreCase |
    RegexOptions.IgnorePatternWhitespace |
    RegexOptions.Singleline |
    RegexOptions.Compiled).Groups["moviePlot"].Value;
     

    Attachments

    • IMDB_MP13x.zip
      6.4 KB
    Last edited:

    jant

    New Member
    October 13, 2017
    2
    0
    55
    Home Country
    Germany Germany
    So now all the en imdb have stopped working. What happened? Any IMDB change? thx
     

    DrJekell

    MP Donator
  • Premium Supporter
  • December 30, 2007
    14
    2
    Home Country
    United States of America United States of America
    This script fixed the Plot issue but actors still doesn't work. Anyone no what is going on? IMDB scripts haven't worked properly for months now.
     
    Last edited:

    Users who are viewing this thread

    Top Bottom