Search code examples
imdbimdbpy

IMDbPY can't get age restriction


I can't find how to get the pc rating or age restriction from imbdPy. Can someone assist please. Looking for Age restriction and whether it has one or more of VLSNP. If it's not in this dictionary does it mean it doesn't store it?

{
            'tv schedule': 'airing',
            'user rating':  'rating',
            'plot summary': 'plot',
            'plot summaries': 'plot',
            'directed by':  'director',
            'created by': 'creator',
            'writing credits': 'writer',
            'produced by':  'producer',
            'original music by':    'original music',
            'non-original music by':    'non-original music',
            'music':    'original music',
            'cinematography by':    'cinematographer',
            'cinematography':   'cinematographer',
            'film editing by':  'editor',
            'film editing': 'editor',
            'editing':  'editor',
            'actors':   'cast',
            'actresses':    'cast',
            'casting by':   'casting director',
            'casting':  'casting director',
            'art direction by': 'art direction',
            'set decoration by':    'set decoration',
            'costume design by':    'costume designer',
            'costume design':    'costume designer',
            'makeup department':    'make up',
            'makeup':    'make up',
            'make-up':    'make up',
            'production management':    'production manager',
            'production company':    'production companies',
            'second unit director or assistant director':
                                            'assistant director',
            'second unit director':   'assistant director',
            'sound department': 'sound crew',
            'costume and wardrobe department': 'costume department',
            'special effects by':   'special effects',
            'visual effects by':    'visual effects',
            'special effects company':   'special effects companies',
            'stunts':   'stunt performer',
            'other crew':   'miscellaneous crew',
            'misc crew':   'miscellaneous crew',
            'miscellaneouscrew':   'miscellaneous crew',
            'crewmembers': 'miscellaneous crew',
            'crew members': 'miscellaneous crew',
            'other companies': 'miscellaneous companies',
            'misc companies': 'miscellaneous companies',
            'miscellaneous company': 'miscellaneous companies',
            'misc company': 'miscellaneous companies',
            'other company': 'miscellaneous companies',
            'aka':  'akas',
            'also known as':    'akas',
            'country':  'countries',
            'production country':  'countries',
            'production countries':  'countries',
            'genre': 'genres',
            'runtime':  'runtimes',
            'lang': 'languages',
            'color': 'color info',
            'cover': 'cover url',
            'full-size cover': 'full-size cover url',
            'seasons': 'number of seasons',
            'language': 'languages',
            'certificate':  'certificates',
            'certifications':   'certificates',
            'certification':    'certificates',
            'miscellaneous links':  'misc links',
            'miscellaneous':    'misc links',
            'soundclips':   'sound clips',
            'videoclips':   'video clips',
            'photographs':  'photo sites',
            'distributor': 'distributors',
            'distribution': 'distributors',
            'distribution companies': 'distributors',
            'distribution company': 'distributors',
            'guest': 'guests',
            'guest appearances': 'guests',
            'tv guests': 'guests',
            'notable tv guest appearances': 'guests',
            'episodes cast': 'guests',
            'episodes number': 'number of episodes',
            'amazon review': 'amazon reviews',
            'merchandising': 'merchandising links',
            'merchandise': 'merchandising links',
            'sales': 'merchandising links',
            'faq': 'faqs',
            'parental guide': 'parents guide',
            'frequently asked questions': 'faqs'}

Solution

  • No, that's just a list of aliases for some keywords.

    The keys you are looking for are:

    • certificates
    • mpaa

    An example:

    >>> import imdb
    >>> ia = imdb.IMDb()
    >>> he = ia.get_movie('3460252') # The Hateful Eight
    
    >>> print he.get('mpaa')
    Rated R for strong bloody violence, a scene of violent sexual content, language and some graphic nudity
    
    >>> print he.get('certificates')
    [u'Argentina:16::(with warning)', u'Australia:R18+', u'Austria:16', u'Brazil:18', u'Canada:18A::(Alberta/British Columbia/Manitoba/Ontario)', u'Canada:13+::(Quebec)', u'Chile:14', u'Czech Republic:15', u'Denmark:15', u'Finland:K-16', u'France:12::(with warning)', u'Germany:16', u'Hong Kong:III', u'Hungary:18', u'India:A', u'Ireland:18', u'Italy:T', u'Japan:R18+', u'Japan:R15+::(edited version)', u'Mexico:C', u'Netherlands:16', u'New Zealand:R18', u'Norway:15', u'Portugal:M/16', u'Russia:18+', u'Singapore:R21', u'South Korea:18', u'Spain:18', u'Sweden:15', u'Switzerland:16', u'Taiwan:R-18', u'Thailand:18', u'UK:18', u'USA:R::(certificate #50077)']
    ))))