def __init__(self, params): self.TMDb = tmdbv3api.TMDb() self.TMDb.api_key = params["apikey"] self.TMDb.language = params["language"] response = tmdbv3api.Configuration().info() if hasattr(response, "status_message"): raise Failed("TMDb Error: {}".format(response.status_message)) self.apikey = params["apikey"] self.language = params["language"] self.Movie = tmdbv3api.Movie() self.TV = tmdbv3api.TV() self.Discover = tmdbv3api.Discover() self.Trending = tmdbv3api.Trending() self.Keyword = tmdbv3api.Keyword() self.List = tmdbv3api.List() self.Company = tmdbv3api.Company() self.Network = tmdbv3api.Network() self.Collection = tmdbv3api.Collection() self.Person = tmdbv3api.Person() self.image_url = "https://image.tmdb.org/t/p/original"
def __init__(self, config, params): self.config = config self.TMDb = tmdbv3api.TMDb(session=self.config.session) self.TMDb.api_key = params["apikey"] self.TMDb.language = params["language"] try: response = tmdbv3api.Configuration().info() if hasattr(response, "status_message"): raise Failed(f"TMDb Error: {response.status_message}") except TMDbException as e: raise Failed(f"TMDb Error: {e}") self.apikey = params["apikey"] self.language = params["language"] self.Movie = tmdbv3api.Movie() self.TV = tmdbv3api.TV() self.Discover = tmdbv3api.Discover() self.Trending = tmdbv3api.Trending() self.Keyword = tmdbv3api.Keyword() self.List = tmdbv3api.List() self.Company = tmdbv3api.Company() self.Network = tmdbv3api.Network() self.Collection = tmdbv3api.Collection() self.Person = tmdbv3api.Person() self.image_url = "https://image.tmdb.org/t/p/original"
import tmdbv3api as TM from adapt.intent import IntentBuilder from mycroft.skills.core import MycroftSkill from mycroft.util.log import getLogger import requests __author__ = 'eClarity' LOGGER = getLogger(__name__) tmdb = TM.TMDb() collection = TM.Collection() company = TM.Company() configuration = TM.Configuration() discover = TM.Discover() genre = TM.Genre() movie = TM.Movie() person = TM.Person() season = TM.Season() tv = TM.TV() ##This will eventually move to the mycroft configuration class TmdbSkill(MycroftSkill): def __init__(self): super(TmdbSkill, self).__init__(name="TmdbSkill") tmdb.api_key = self.settings.get("v3api") tmdb.language = "en_US"