/usr/lib/python2.7/dist-packages/tmdbsimple/genres.py is in python-tmdbsimple 2.1.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | # -*- coding: utf-8 -*-
"""
tmdbsimple.genres
~~~~~~~~~~~~~~~~~
This module implements the Genres functionality of tmdbsimple.
Created by Celia Oakley on 2013-10-31.
:copyright: (c) 2013-2018 by Celia Oakley
:license: GPLv3, see LICENSE for more details
"""
from .base import TMDB
class Genres(TMDB):
"""
Genres functionality.
See: https://developers.themoviedb.org/3/genres
"""
BASE_PATH = 'genre'
URLS = {
'movie_list': '/movie/list',
'tv_list': '/tv/list',
'movies': '/{id}/movies',
}
def __init__(self, id=0):
super(Genres, self).__init__()
self.id = id
def movie_list(self, **kwargs):
"""
Get the list of Movie genres.
Args:
language: (optional) ISO 639-1 code.
Returns:
A dict respresentation of the JSON returned from the API.
"""
path = self._get_path('movie_list')
response = self._GET(path, kwargs)
self._set_attrs_to_values(response)
return response
def tv_list(self, **kwargs):
"""
Get the list of TV genres.
Args:
language: (optional) ISO 639-1 code.
Returns:
A dict respresentation of the JSON returned from the API.
"""
path = self._get_path('tv_list')
response = self._GET(path, kwargs)
self._set_attrs_to_values(response)
return response
def movies(self, **kwargs):
"""
Get the list of movies for a particular genre by id. By default, only
movies with 10 or more votes are included.
Args:
page: (optional) Minimum 1, maximum 1000.
language: (optional) ISO 639-1 code.
include_all_movies: (optional) Toggle the inclusion of all movies
and not just those with 10 or more ratings.
Expected value is: True or False.
include_adult: (optional) Toggle the inclusion of adult titles.
Expected value is: True or False.
Returns:
A dict respresentation of the JSON returned from the API.
"""
path = self._get_id_path('movies')
response = self._GET(path, kwargs)
self._set_attrs_to_values(response)
return response
|