コード例 #1
0
 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"
コード例 #2
0
 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"
コード例 #3
0
ファイル: __init__.py プロジェクト: GPVM/tmdb-skill
__version__ = "0.1.2"

LOGGER = getLogger(__name__)

TMDB = {
    "tmdb": tmdbv3api.TMDb(),
    # "collection": tmdbv3api.Collection(),
    # "company": tmdbv3api.Company(),
    # "configuration": tmdbv3api.Configuration(),
    "discover": tmdbv3api.Discover(),
    "genre": tmdbv3api.Genre(),
    "movie": tmdbv3api.Movie(),
    "movie": tmdbv3api.Movie(),
    # "person": tmdbv3api.Person(),
    # "season": tmdbv3api.Season(),
    "tv": tmdbv3api.TV()
}


class Tmdb(MycroftSkill):
    def __init__(self):
        super(Tmdb, self).__init__(name="Tmdb")
        self.movieID = None
        self.movieDetails = None
        self.tvID = None
        self.tvDetails = None

    def initialize(self):
        TMDB["tmdb"].api_key = self.settings.get("apiv3")
        TMDB["tmdb"].language = self.lang
        self.AvalGenres = self.getAvalGenres()
コード例 #4
0
ファイル: __init__.py プロジェクト: builderjer/skill-tmdb
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"

    def initialize(self):
        search_actor_intent = IntentBuilder("SearchActorIntent").require(
            "SearchActorKeyword").require("Actor").build()
        self.register_intent(search_actor_intent,
                             self.handle_search_actor_intent)