Kodi Community Forum

Full Version: [IMDB] scraper enhancement for parental ratings
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I made some modifications to the current metadata.common.imdb.com\imdb.xml (on XBMC 11) to enhance the return of parental ratings.

The most recent version of the ParseIMDBUSACERT function only captures data from the MPAA portion of the IMDB details page. As it turns out, the MPAA rating and TV ratings are more often posted at the top. This enhancement processes both sections of the page, with preference given to the MPAA description, if it exists.

This code now returns ratings that would not be returned with the current MPAA parser, including, but not limited to:
TV-G, TV-Y7, TV-PG, TV-MA (,etc)
APPROVED (an MPAA rating prior to Nov 1, 1968)
(other MPAA ratings that the editor included at the top, but not in the MPAA section)

Many thanks to Scudlee Cool for helping me with the regex to get the desired results.

Please let me know if this is not the correct forum to post media scraper change submissions.


    <ParseIMDBUSACert dest="5">
        <RegExp input="$$2" output="&lt;details&gt;&lt;mpaa&gt;\1&lt;/mpaa&gt;&lt;/details&gt;" dest="5">
            <RegExp input="$$1" output="\1" dest="16">
                <expression>class=&quot;absmiddle&quot; title=&quot;([^&quot;]*)&quot;</expression>
            <RegExp input="$$16" output="\2" dest="16">
                <expression noclean="1">(NOT_RATED)?(.*)</expression>
            <RegExp input="$$16" output="$INFO[certprefix]\1" dest="2">
                <RegExp input="$$16" output="-\1" dest="16">
                    <expression clear="yes" repeat="yes" noclean="1">_?([^_]+)</expression>
                <expression noclean="1">-(.*)</expression>
            <RegExp input="$$1" output="$INFO[certprefix]\1" dest="2">
                <expression>MPAA&lt;/a&gt;\)&lt;/h4&gt;\n?&lt;span itemprop=&quot;contentRating&quot;&gt;Rated\s([^&lt;]*)</expression>
            <expression noclean="1" />
Thanks for the info! I'm going to give this a shot when I get home from work! I'm hoping/assuming that this should work on XBMC 12 as well?