Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- from pycinema.mdb import MovieDB
- API = MovieDB('API KEY GOES HERE')
- class Actor:
- def __init__(self, actor_id):
- api = API.get_actor(actor_id)
- self.name = api['name']
- self.biography = api['biography']
- self.actorid = api['id']
- class Movie:
- def __init__(self):
- pass
- class Series:
- def __init__(self):
- pass
- ----------------------------------------------------------------------------
- # -*- coding: utf-8 -*-
- import requests
- class MovieDB:
- def __init__(self, api_key):
- self.api_key = api_key
- def get_actor(self, actor_id):
- response = requests.get('http://api.themoviedb.org/3/person/' + str(actor_id) + '?api_key=' + str(self.api_key)).json()
- return {'name': response['name'], 'id': actor_id, 'biography': response['biography']}
Advertisement
Add Comment
Please, Sign In to add comment