diff options
Diffstat (limited to 'pyload/plugins/hoster/StreamCz.py')
-rw-r--r-- | pyload/plugins/hoster/StreamCz.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/pyload/plugins/hoster/StreamCz.py b/pyload/plugins/hoster/StreamCz.py index 0a70e3c48..1c1b7f204 100644 --- a/pyload/plugins/hoster/StreamCz.py +++ b/pyload/plugins/hoster/StreamCz.py @@ -21,17 +21,18 @@ def getInfo(urls): class StreamCz(Hoster): - __name__ = "StreamCz" - __type__ = "hoster" + __name__ = "StreamCz" + __type__ = "hoster" __version__ = "0.2" __pattern__ = r'https?://(?:www\.)?stream\.cz/[^/]+/\d+.*' __description__ = """Stream.cz hoster plugin""" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_NAME_PATTERN = r'<link rel="video_src" href="http://www.stream.cz/\w+/(\d+)-([^"]+)" />' + NAME_PATTERN = r'<link rel="video_src" href="http://www\.stream\.cz/\w+/(\d+)-([^"]+)" />' OFFLINE_PATTERN = r'<h1 class="commonTitle">Str.nku nebylo mo.n. nal.zt \(404\)</h1>' CDN_PATTERN = r'<param name="flashvars" value="[^"]*&id=(?P<ID>\d+)(?:&cdnLQ=(?P<cdnLQ>\d*))?(?:&cdnHQ=(?P<cdnHQ>\d*))?(?:&cdnHD=(?P<cdnHD>\d*))?&' @@ -41,8 +42,8 @@ class StreamCz(Hoster): self.multiDL = True self.resumeDownload = True - def process(self, pyfile): + def process(self, pyfile): self.html = self.load(pyfile.url, decode=True) if re.search(self.OFFLINE_PATTERN, self.html): @@ -50,7 +51,7 @@ class StreamCz(Hoster): m = re.search(self.CDN_PATTERN, self.html) if m is None: - self.fail("Parse error (CDN)") + self.error(_("CDN_PATTERN not found")) cdn = m.groupdict() self.logDebug(cdn) for cdnkey in ("cdnHD", "cdnHQ", "cdnLQ"): @@ -58,13 +59,13 @@ class StreamCz(Hoster): cdnid = cdn[cdnkey] break else: - self.fail("Stream URL not found") + self.fail(_("Stream URL not found")) - m = re.search(self.FILE_NAME_PATTERN, self.html) + m = re.search(self.NAME_PATTERN, self.html) if m is None: - self.fail("Parse error (NAME)") + self.error(_("NAME_PATTERN not found")) pyfile.name = "%s-%s.%s.mp4" % (m.group(2), m.group(1), cdnkey[-2:]) download_url = "http://cdn-dispatcher.stream.cz/?id=" + cdnid - self.logInfo("STREAM (%s): %s" % (cdnkey[-2:], download_url)) + self.logInfo(_("STREAM: %s") % cdnkey[-2:], download_url) self.download(download_url) |