Added custom url code handling
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
from couchpotato.core.helpers.rss import RSS
|
from couchpotato.core.helpers.rss import RSS
|
||||||
from couchpotato.core.helpers.variable import tryInt
|
from couchpotato.core.helpers.variable import tryInt, splitString
|
||||||
from couchpotato.core.logger import CPLog
|
from couchpotato.core.logger import CPLog
|
||||||
from couchpotato.core.providers.automation.base import Automation
|
from couchpotato.core.providers.automation.base import Automation
|
||||||
from xml.etree.ElementTree import QName
|
from xml.etree.ElementTree import QName
|
||||||
@@ -11,17 +11,27 @@ log = CPLog(__name__)
|
|||||||
class Rottentomatoes(Automation, RSS):
|
class Rottentomatoes(Automation, RSS):
|
||||||
|
|
||||||
interval = 1800
|
interval = 1800
|
||||||
urls = {
|
|
||||||
'namespace': 'http://www.rottentomatoes.com/xmlns/rtmovie/',
|
|
||||||
'theater': 'http://www.rottentomatoes.com/syndication/rss/in_theaters.xml',
|
|
||||||
}
|
|
||||||
|
|
||||||
def getIMDBids(self):
|
def getIMDBids(self):
|
||||||
|
|
||||||
movies = []
|
movies = []
|
||||||
|
|
||||||
rss_movies = self.getRSSData(self.urls['theater'])
|
rotten_tomatoes_namespace = 'http://www.rottentomatoes.com/xmlns/rtmovie/'
|
||||||
rating_tag = str(QName(self.urls['namespace'], 'tomatometer_percent'))
|
enablers = [tryInt(x) for x in splitString(self.conf('automation_urls_use'))]
|
||||||
|
urls = splitString(self.conf('automation_urls'))
|
||||||
|
|
||||||
|
index = -1
|
||||||
|
|
||||||
|
for url in urls:
|
||||||
|
|
||||||
|
index += 1
|
||||||
|
if not enablers[index]:
|
||||||
|
continue
|
||||||
|
|
||||||
|
rss_movies = self.getRSSData(url)
|
||||||
|
rating_tag = str(QName(rotten_tomatoes_namespace, 'tomatometer_percent'))
|
||||||
|
|
||||||
for movie in rss_movies:
|
for movie in rss_movies:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user