|
|
|
@ -14,8 +14,54 @@ class TmdbController():
|
|
|
|
|
|
|
|
|
|
self.tmdbLanguage = TmdbController.DEFAULT_LANGUAGE
|
|
|
|
|
|
|
|
|
|
def queryShow(self, showId):
|
|
|
|
|
"""
|
|
|
|
|
First level keys in the response object:
|
|
|
|
|
adult bool
|
|
|
|
|
backdrop_path str
|
|
|
|
|
created_by []
|
|
|
|
|
episode_run_time []
|
|
|
|
|
first_air_date str YYYY-MM-DD
|
|
|
|
|
genres []
|
|
|
|
|
homepage str
|
|
|
|
|
id int
|
|
|
|
|
in_production bool
|
|
|
|
|
languages []
|
|
|
|
|
last_air_date str YYYY-MM-DD
|
|
|
|
|
last_episode_to_air {}
|
|
|
|
|
name str
|
|
|
|
|
next_episode_to_air null
|
|
|
|
|
networks []
|
|
|
|
|
number_of_episodes int
|
|
|
|
|
number_of_seasons int
|
|
|
|
|
origin_country []
|
|
|
|
|
original_language str
|
|
|
|
|
original_name str
|
|
|
|
|
overview str
|
|
|
|
|
popularity float
|
|
|
|
|
poster_path str
|
|
|
|
|
production_companies []
|
|
|
|
|
production_countries []
|
|
|
|
|
seasons []
|
|
|
|
|
spoken_languages []
|
|
|
|
|
status str
|
|
|
|
|
tagline str
|
|
|
|
|
type str
|
|
|
|
|
vote_average float
|
|
|
|
|
vote_count int
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
urlParams = f"?language={self.tmdbLanguage}&api_key={self.__tmdbApiKey}"
|
|
|
|
|
|
|
|
|
|
tmdbUrl = f"https://api.themoviedb.org/3/tv/{showId}W{urlParams}"
|
|
|
|
|
|
|
|
|
|
#TODO Check for result
|
|
|
|
|
try:
|
|
|
|
|
return requests.get(tmdbUrl).json()
|
|
|
|
|
except:
|
|
|
|
|
return {}
|
|
|
|
|
|
|
|
|
|
def queryTmdb(self, showId, season, episode):
|
|
|
|
|
def queryEpisode(self, showId, season, episode):
|
|
|
|
|
"""
|
|
|
|
|
First level keys in the response object:
|
|
|
|
|
air_date str 'YYY-MM-DD'
|
|
|
|
|