Adding in a new source for automation.

This commit is contained in:
Steven Lu
2013-12-08 01:04:04 -05:00
parent 26f5e8aa4b
commit d22237a5cc
2 changed files with 46 additions and 0 deletions
@@ -0,0 +1,24 @@
from .main import PopularMovies
def start():
return PopularMovies()
config = [{
'name': 'popular_movies',
'groups': [
{
'tab': 'automation',
'list': 'automation_providers',
'name': 'popular_movies_automation',
'label': 'Popular Movies',
'description': 'Imports the top titles of movies that have been in theaters.',
'options': [
{
'name': 'automation_enabled',
'default': False,
'type': 'enabler',
},
],
},
],
}]
@@ -0,0 +1,22 @@
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.automation.base import Automation
import datetime
log = CPLog(__name__)
class PopularMovies(Automation):
interval = 1800
url = 'https://s3.amazonaws.com/popular-movies/movies.json'
def getIMDBids(self):
movies = []
retrieved_movies = self.getJsonData(self.url)
for movie in retrieved_movies.get('movies'):
imdb_id = movie.get('imdb_id')
movies.append(imdb_id)
return movies