示例#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
import io
import aiohttp
import requests
import string
import asyncio
import html

load_dotenv()

DISC_TOKEN = os.getenv('DISCORD_TOKEN')
TMDB_TOKEN = os.getenv('TMDB_API_KEY')

#API instantiation
client = discord.Client()
movie = tmdbv3api.Movie()
person = tmdbv3api.Person()
rbapi = rarbgapi.RarbgAPI()

#magnet link shortener url for post method
mgnet = "http://mgnet.me/api/create"


#function which gets the magnet link from rarbg and shortens it using mgnet.me api
def getID(title):
    tmp = title
    title = ''
    for i in tmp:
        if i in string.punctuation:
            continue
        title += i
    tmp = title
示例#4
0
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"

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