diff --git a/couchpotato/core/providers/userscript/flickchart/__init__.py b/couchpotato/core/providers/userscript/flickchart/__init__.py new file mode 100644 index 00000000..89d45d9c --- /dev/null +++ b/couchpotato/core/providers/userscript/flickchart/__init__.py @@ -0,0 +1,6 @@ +from .main import Flickchart + +def start(): + return Flickchart() + +config = [] diff --git a/couchpotato/core/providers/userscript/flickchart/main.py b/couchpotato/core/providers/userscript/flickchart/main.py new file mode 100644 index 00000000..a66bd38f --- /dev/null +++ b/couchpotato/core/providers/userscript/flickchart/main.py @@ -0,0 +1,30 @@ +from couchpotato.core.event import fireEvent +from couchpotato.core.logger import CPLog +from couchpotato.core.providers.userscript.base import UserscriptBase +import traceback + +log = CPLog(__name__) + + +class Flickchart(UserscriptBase): + + includes = ['http://www.flickchart.com/movie/*'] + + def getMovie(self, url): + + try: + data = self.getUrl(url) + except: + return + + try: + start = data.find('') + end = data.find('', start) + page_title = data[start + len(''):end].strip().split('-') + + year_name = fireEvent('scanner.name_year', page_title[0], single = True) + + return self.search(**year_name) + except: + log.error('Failed parsing page for title and year: %s', traceback.format_exc()) +