From 93592862b520a862c01f80c019e5c4bc43746c19 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 16:54:20 +0200 Subject: [SimpleHoster] Better inline docs + changed "FILE_OFFLINE_PATTERN" to "OFFLINE_PATTERN" --- module/plugins/hoster/StreamCz.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index bbef31a67..227324097 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -28,7 +28,7 @@ def getInfo(urls): for url in urls: html = getURL(url) - if re.search(StreamCz.FILE_OFFLINE_PATTERN, html): + if re.search(StreamCz.OFFLINE_PATTERN, html): # File offline result.append((url, 0, 1, url)) else: @@ -45,7 +45,7 @@ class StreamCz(Hoster): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - FILE_OFFLINE_PATTERN = r'

Str.nku nebylo mo.n. nal.zt \(404\)

' + OFFLINE_PATTERN = r'

Str.nku nebylo mo.n. nal.zt \(404\)

' FILE_NAME_PATTERN = r'' CDN_PATTERN = r'\d+)(?:&cdnLQ=(?P\d*))?(?:&cdnHQ=(?P\d*))?(?:&cdnHD=(?P\d*))?&' @@ -57,7 +57,7 @@ class StreamCz(Hoster): self.html = self.load(pyfile.url, decode=True) - if re.search(self.FILE_OFFLINE_PATTERN, self.html): + if re.search(self.OFFLINE_PATTERN, self.html): self.offline() found = re.search(self.CDN_PATTERN, self.html) -- cgit v1.2.3 From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hoster/StreamCz.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 227324097..9e5b6233f 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: zoidberg """ import re -- cgit v1.2.3 From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/hoster/StreamCz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 9e5b6233f..1b2439d98 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -59,7 +59,7 @@ class StreamCz(Hoster): self.offline() found = re.search(self.CDN_PATTERN, self.html) - if found is None: + if not found: self.fail("Parse error (CDN)") cdn = found.groupdict() self.logDebug(cdn) @@ -71,7 +71,7 @@ class StreamCz(Hoster): self.fail("Stream URL not found") found = re.search(self.FILE_NAME_PATTERN, self.html) - if found is None: + if not found: self.fail("Parse error (NAME)") pyfile.name = "%s-%s.%s.mp4" % (found.group(2), found.group(1), cdnkey[-2:]) -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/hoster/StreamCz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 1b2439d98..9e5b6233f 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -59,7 +59,7 @@ class StreamCz(Hoster): self.offline() found = re.search(self.CDN_PATTERN, self.html) - if not found: + if found is None: self.fail("Parse error (CDN)") cdn = found.groupdict() self.logDebug(cdn) @@ -71,7 +71,7 @@ class StreamCz(Hoster): self.fail("Stream URL not found") found = re.search(self.FILE_NAME_PATTERN, self.html) - if not found: + if found is None: self.fail("Parse error (NAME)") pyfile.name = "%s-%s.%s.mp4" % (found.group(2), found.group(1), cdnkey[-2:]) -- cgit v1.2.3 From b3b82f960e553dbabbaf4f1d276b560e2cfffab0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 19 Jul 2014 14:48:40 +0200 Subject: [StreamCz] Parse https --- module/plugins/hoster/StreamCz.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 9e5b6233f..7614c0cc3 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -16,6 +16,7 @@ """ import re + from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL @@ -36,17 +37,21 @@ def getInfo(urls): class StreamCz(Hoster): __name__ = "StreamCz" + __version__ = "0.2" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?stream.cz/[^/]+/\d+.*' - __version__ = "0.1" + + __pattern__ = r'https?://(?:www\.)?stream\.cz/[^/]+/\d+.*' + __description__ = """Stream.cz hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - OFFLINE_PATTERN = r'

Str.nku nebylo mo.n. nal.zt \(404\)

' FILE_NAME_PATTERN = r'' + OFFLINE_PATTERN = r'

Str.nku nebylo mo.n. nal.zt \(404\)

' + CDN_PATTERN = r'\d+)(?:&cdnLQ=(?P\d*))?(?:&cdnHQ=(?P\d*))?(?:&cdnHD=(?P\d*))?&' + def setup(self): self.multiDL = True self.resumeDownload = True -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/hoster/StreamCz.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 7614c0cc3..e68130389 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -63,10 +63,10 @@ class StreamCz(Hoster): if re.search(self.OFFLINE_PATTERN, self.html): self.offline() - found = re.search(self.CDN_PATTERN, self.html) - if found is None: + m = re.search(self.CDN_PATTERN, self.html) + if m is None: self.fail("Parse error (CDN)") - cdn = found.groupdict() + cdn = m.groupdict() self.logDebug(cdn) for cdnkey in ("cdnHD", "cdnHQ", "cdnLQ"): if cdnkey in cdn and cdn[cdnkey] > '': @@ -75,10 +75,10 @@ class StreamCz(Hoster): else: self.fail("Stream URL not found") - found = re.search(self.FILE_NAME_PATTERN, self.html) - if found is None: + m = re.search(self.FILE_NAME_PATTERN, self.html) + if m is None: self.fail("Parse error (NAME)") - pyfile.name = "%s-%s.%s.mp4" % (found.group(2), found.group(1), cdnkey[-2:]) + 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)) -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/StreamCz.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index e68130389..526e61eea 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -1,24 +1,9 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - import re -from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL +from module.plugins.Hoster import Hoster def getInfo(urls): @@ -37,8 +22,8 @@ def getInfo(urls): class StreamCz(Hoster): __name__ = "StreamCz" - __version__ = "0.2" __type__ = "hoster" + __version__ = "0.2" __pattern__ = r'https?://(?:www\.)?stream\.cz/[^/]+/\d+.*' -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hoster/StreamCz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 526e61eea..dd5108e1c 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -28,8 +28,8 @@ class StreamCz(Hoster): __pattern__ = r'https?://(?:www\.)?stream\.cz/[^/]+/\d+.*' __description__ = """Stream.cz hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + FILE_NAME_PATTERN = r'' OFFLINE_PATTERN = r'

Str.nku nebylo mo.n. nal.zt \(404\)

' -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/StreamCz.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index dd5108e1c..de48a5d13 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -28,6 +28,7 @@ class StreamCz(Hoster): __pattern__ = r'https?://(?:www\.)?stream\.cz/[^/]+/\d+.*' __description__ = """Stream.cz hoster plugin""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 2 --- module/plugins/hoster/StreamCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index de48a5d13..1459ca5f1 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -32,7 +32,7 @@ class StreamCz(Hoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_NAME_PATTERN = r'' + FILE_NAME_PATTERN = r'' OFFLINE_PATTERN = r'

Str.nku nebylo mo.n. nal.zt \(404\)

' CDN_PATTERN = r'\d+)(?:&cdnLQ=(?P\d*))?(?:&cdnHQ=(?P\d*))?(?:&cdnHD=(?P\d*))?&' -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hoster/StreamCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 1459ca5f1..d4ebd7701 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -42,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): -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hoster/StreamCz.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index d4ebd7701..5f3971df3 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -51,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"): @@ -59,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) if m is None: - self.fail("Parse error (NAME)") + self.error(_("FILE_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) -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/StreamCz.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 5f3971df3..4232c029d 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -21,15 +21,15 @@ 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""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] FILE_NAME_PATTERN = r'' -- cgit v1.2.3 From 772e47ef806d18fd209e910be0535bce7c07dc7b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Nov 2014 22:47:07 +0100 Subject: Update all other plugins --- module/plugins/hoster/StreamCz.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 4232c029d..05f2bdee7 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -32,7 +32,7 @@ class StreamCz(Hoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_NAME_PATTERN = r'' + NAME_PATTERN = r'' OFFLINE_PATTERN = r'

Str.nku nebylo mo.n. nal.zt \(404\)

' CDN_PATTERN = r'\d+)(?:&cdnLQ=(?P\d*))?(?:&cdnHQ=(?P\d*))?(?:&cdnHD=(?P\d*))?&' @@ -61,9 +61,9 @@ class StreamCz(Hoster): else: 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.error(_("FILE_NAME_PATTERN not found")) + 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 -- cgit v1.2.3 From 67587fbe0335cacfde28a86ba729b9d567ce1da7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 7 Dec 2014 00:27:18 +0100 Subject: Plugin code cosmetics (3) --- module/plugins/hoster/StreamCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 05f2bdee7..95d1e12ba 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -39,8 +39,8 @@ class StreamCz(Hoster): def setup(self): - self.multiDL = True self.resumeDownload = True + self.multiDL = True def process(self, pyfile): -- cgit v1.2.3 From 6151e81fa0b325dffda3da4228d5821e73db3ef3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Dec 2014 01:19:46 +0100 Subject: Fix __version__ format in some plugins --- module/plugins/hoster/StreamCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 95d1e12ba..6813271d0 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -23,7 +23,7 @@ def getInfo(urls): class StreamCz(Hoster): __name__ = "StreamCz" __type__ = "hoster" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'https?://(?:www\.)?stream\.cz/[^/]+/\d+.*' -- cgit v1.2.3 From cdb06469a640c1875229903a2dbdfa8be469b5bc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:52:30 +0100 Subject: Improve a lot of plugin __pattern__ --- module/plugins/hoster/StreamCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/StreamCz.py') diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 6813271d0..11d4efcdb 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -25,7 +25,7 @@ class StreamCz(Hoster): __type__ = "hoster" __version__ = "0.20" - __pattern__ = r'https?://(?:www\.)?stream\.cz/[^/]+/\d+.*' + __pattern__ = r'https?://(?:www\.)?stream\.cz/[^/]+/\d+' __description__ = """Stream.cz hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3