Add "I Just Watched" Reddit to userscripts. fix #2621

This commit is contained in:
Ruud
2014-03-08 14:05:49 +01:00
parent 3172a4d030
commit 9e471ac389
2 changed files with 24 additions and 0 deletions
@@ -0,0 +1,7 @@
from .main import Reddit
def start():
return Reddit()
config = []
@@ -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'))