Adding in a new source for automation.
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user