From a6f9ad63308bca18f41c38fdf29fb0caaec98db1 Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 16 Dec 2011 22:25:12 +0100 Subject: [PATCH] Userscript update ( Fix + New Provider ) Thanks to DxCx --- .../core/providers/userscript/youteather/__init__.py | 6 ++++++ .../core/providers/userscript/youteather/main.py | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 couchpotato/core/providers/userscript/youteather/__init__.py create mode 100644 couchpotato/core/providers/userscript/youteather/main.py diff --git a/couchpotato/core/providers/userscript/youteather/__init__.py b/couchpotato/core/providers/userscript/youteather/__init__.py new file mode 100644 index 00000000..a07bf56b --- /dev/null +++ b/couchpotato/core/providers/userscript/youteather/__init__.py @@ -0,0 +1,6 @@ +from .main import YouTheater + +def start(): + return YouTheater() + +config = [] diff --git a/couchpotato/core/providers/userscript/youteather/main.py b/couchpotato/core/providers/userscript/youteather/main.py new file mode 100644 index 00000000..314495f2 --- /dev/null +++ b/couchpotato/core/providers/userscript/youteather/main.py @@ -0,0 +1,12 @@ +from couchpotato.core.providers.userscript.base import UserscriptBase +import re + +class YouTheater(UserscriptBase): + id_re = re.compile("view\.php\?id=(\d+)") + includes = ['http://www.youtheater.com/view.php?id=*', 'http://youtheater.com/view.php?id=*', + 'http://www.sratim.co.il/view.php?id=*', 'http://sratim.co.il/view.php?id=*'] + + def getMovie(self, url): + id = self.id_re.findall(url)[0] + url = "http://www.youtheater.com/view.php?id=%s" % id + return super(YouTheater, self).getMovie(url) \ No newline at end of file