Esempio n. 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"
Esempio n. 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"
Esempio n. 3
0
from datetime import datetime
from mycroft import MycroftSkill, intent_file_handler
from mycroft.util.log import getLogger
from mycroft.util.format import pronounce_number, nice_date, nice_number
import tmdbv3api

__author__ = "*****@*****.**"
__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
Esempio n. 4
0
from django.shortcuts import render, render_to_response, redirect
from django.template import RequestContext
from django.contrib.auth.models import User, auth
from django.http import HttpResponse, Http404
from django.contrib import messages
import json
from django.views.decorators.csrf import csrf_exempt
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from chatterbot import ChatBot
import operator
import tmdbv3api as tb
from django.contrib.auth import login as auth_login
tmdb = tb.TMDb()
tmdb.api_key = 'ef9d09282b5ec0b221147c2cff9fe58d'
tmdb.language = 'en'
tmdb.debug = True
movie = tb.Movie()


@csrf_exempt
def get_response(request):
    response = {'status': None}

    if request.method == 'POST':
        data = json.loads(request.body.decode('utf-8'))
        message = data['message']
        stop_words = set(stopwords.words('english'))
        word_tokens = word_tokenize(message)
        filtered_sentence = [w for w in word_tokens if not w in stop_words]
Esempio n. 5
0
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []

#TMDB API Keys

from tmdbv3api import TMDb
API_KEY = "9f330f7fda1e5169e70f092cbdfb589e"
API_READ_ACCESS_TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI5ZjMzMGY3ZmRhMWU1MTY5ZTcwZjA5MmNiZGZiNTg5ZSIsInN1YiI6IjVhZDE1ZjVhMGUwYTI2NmMyMjAwNGYyNCIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.8jUYHf8UFtamnvLatZF3mO_yaAbWiKV_KC9IOwxTdfg"
tmdb = TMDb()
tmdb.api_key = API_KEY

#register API Key in project
tmdb = tmdbv3api.TMDb()
tmdb.api_key = API_KEY
# Application definition

INSTALLED_APPS = [
    'main.apps.MainConfig',
    'user.apps.UserConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]
ALLOWED_HOSTS = [
    'broadway.herokuapp.com',
Esempio n. 6
0
from datetime import datetime
import os
from mycroft import MycroftSkill, intent_file_handler
from mycroft.util.format import pronounce_number, nice_date, nice_number
from mycroft.util.log import LOG

import tmdbv3api

__author__ = "*****@*****.**"
__version__ = "0.2.0"
__api__= "6b064259b900f7d4fd32f3c74ac35207"

LOGGER = LOG(__name__)

TMDB = tmdbv3api.TMDb()
MOVIE = tmdbv3api.Movie()

class MovieMaster(MycroftSkill):
	def __init__(self):
		"""A Mycroft skill to access the free TMDb api from https://www.themoviedb.org/"""
		super(MovieMaster, self).__init__(name="MovieMaster")
		self._api = None
		self._searchDepth = None
	
	def initialize(self):
		""" This sets some variables that do not change during the execution of the script"""
		
		# Try and get the settings from https://account.mycroft.ai/skills
		api = self.settings.get("apiv3")
		if api == "Default" or api == "":
			TMDB.api_key = __api__
Esempio n. 7
0
# along with Mycroft Core.  If not, see <http://www.gnu.org/licenses/>.

#from tmdbv3api import TMDb
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):
Esempio n. 8
0
import json
import kafka as kf
import tmdbv3api as tm

## Set auth keys
with open('/home/n/opt/MindBender_BD/Misc/keys') as keys:
    tmdb_keys = json.load(keys)
    api_key = tmdb_keys["tmdb"]["api_key"]
    read_access_token = tmdb_keys["tmdb"]["read_access_token"]
tmdb = tm.TMDb()
tmdb.api_key = api_key

## Connect to Kafka brokers
kafka = kf.KafkaClient("localhost:9099")
producer = kf.SimpleProducer(kafka)

## Find popular movies for the day
movie = tm.Movie()
latest = movie.latest()

with open('/home/n/opt/MindBender_BD/capstone/latest.txt', 'r') as l:
    movie_id = int(l.read())

for x in range(movie_id, latest.id):
    try:
        ## Select details for latest film to send to Kafka broker
        movie_data = {}
        m = movie.details(x)
        movie_data['adult'] = m.adult
        movie_data['budget'] = m.budget
        ## Select first genre from list (most important)
Esempio n. 9
0
 def __init__(self):
     super(MovieMaster, self).__init__(name="MovieMaster")
     self.search_depth = None
     self.movie_db = tmdbv3api.TMDb()
     self.movie = tmdbv3api.Movie()