diff --git a/couchpotato/core/providers/userscript/reddit/__init__.py b/couchpotato/core/providers/userscript/reddit/__init__.py new file mode 100644 index 00000000..a74bbf0d --- /dev/null +++ b/couchpotato/core/providers/userscript/reddit/__init__.py @@ -0,0 +1,7 @@ +from .main import Reddit + + +def start(): + return Reddit() + +config = [] diff --git a/couchpotato/core/providers/userscript/reddit/main.py b/couchpotato/core/providers/userscript/reddit/main.py new file mode 100644 index 00000000..9790f6e2 --- /dev/null +++ b/couchpotato/core/providers/userscript/reddit/main.py @@ -0,0 +1,17 @@ +from couchpotato import fireEvent +from couchpotato.core.helpers.variable import splitString +from couchpotato.core.providers.userscript.base import UserscriptBase + + +class Reddit(UserscriptBase): + + includes = ['*://www.reddit.com/r/Ijustwatched/comments/*'] + + def getMovie(self, url): + name = splitString(url, '/')[-1] + if name.startswith('ijw_'): + name = name[4:] + + year_name = fireEvent('scanner.name_year', name, single = True) + + return self.search(year_name.get('name'), year_name.get('year'))