Automation kinepolis

This commit is contained in:
Ruud
2012-01-25 15:46:15 +01:00
parent e14be4499c
commit 6369293472
2 changed files with 30 additions and 6 deletions
@@ -17,9 +17,6 @@ config = [{
'default': False,
'type': 'enabler',
},
{
'name': 'automation_urls',
},
],
},
],
@@ -1,14 +1,41 @@
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.automation.base import Automation
import xml.etree.ElementTree as XMLTree
log = CPLog(__name__)
class Kinepolis(Automation):
class Kinepolis(Automation, RSS):
def getMovies(self):
urls = {
'top10': 'http://kinepolis.be/nl/top10-box-office/feed',
}
def getIMDBids(self):
if self.isDisabled():
return
return []
movies = []
for key in self.urls:
url = self.urls[key]
cache_key = 'kinepolis.%s' % key
rss_data = self.getCache(cache_key, url)
try:
items = self.getElements(XMLTree.fromstring(rss_data), 'channel/item')
except Exception, e:
log.debug('%s, %s' % (self.getName(), e))
continue
for item in items:
title = self.getTextElement(item, "title").lower()
result = self.search(title)
if result:
if self.isMinimal(result):
movies.append(result)
return movies