From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/hoster/StreamcloudEu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/StreamcloudEu.py') diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 388eb7876..849f3797a 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -18,14 +18,14 @@ class StreamcloudEu(XFileSharingPro): HOSTER_NAME = "streamcloud.eu" - DIRECT_LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.(mp4|flv))",' + LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.(mp4|flv))",' def setup(self): super(StreamcloudEu, self).setup() self.multiDL = True def getDownloadLink(self): - found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S) + found = re.search(self.LINK_PATTERN, self.html, re.S) if found: return found.group(1) @@ -42,7 +42,7 @@ class StreamcloudEu(XFileSharingPro): if found: break - found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S) + found = re.search(self.LINK_PATTERN, self.html, re.S) if found: break -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hoster/StreamcloudEu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/StreamcloudEu.py') diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 849f3797a..a9b2804e4 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -74,7 +74,7 @@ class StreamcloudEu(XFileSharingPro): self.logDebug(self.HOSTER_NAME, inputs) - if 'op' in inputs and inputs['op'] in ('download1', 'download2', 'download3'): + if 'op' in inputs and inputs['op'] in ("download1", "download2", "download3"): if "password" in inputs: if self.passwords: inputs['password'] = self.passwords.pop(0) -- 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/StreamcloudEu.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'module/plugins/hoster/StreamcloudEu.py') diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index a9b2804e4..3cbf015c9 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -25,9 +25,9 @@ class StreamcloudEu(XFileSharingPro): self.multiDL = True def getDownloadLink(self): - found = re.search(self.LINK_PATTERN, self.html, re.S) - if found: - return found.group(1) + m = re.search(self.LINK_PATTERN, self.html, re.S) + if m: + return m.group(1) for i in xrange(5): self.logDebug("Getting download link: #%d" % i) @@ -38,12 +38,12 @@ class StreamcloudEu(XFileSharingPro): self.html = httpRequest.load(self.pyfile.url, post=data, referer=False, cookies=True, decode=True) self.header = httpRequest.header - found = re.search("Location\s*:\s*(.*)", self.header, re.I) - if found: + m = re.search("Location\s*:\s*(.*)", self.header, re.I) + if m: break - found = re.search(self.LINK_PATTERN, self.html, re.S) - if found: + m = re.search(self.LINK_PATTERN, self.html, re.S) + if m: break else: @@ -52,7 +52,7 @@ class StreamcloudEu(XFileSharingPro): else: self.fail("Download link not found") - return found.group(1) + return m.group(1) def getPostParameters(self): for i in xrange(3): @@ -82,9 +82,9 @@ class StreamcloudEu(XFileSharingPro): self.fail("No or invalid passport") if not self.premium: - found = re.search(self.WAIT_PATTERN, self.html) - if found: - wait_time = int(found.group(1)) + 1 + m = re.search(self.WAIT_PATTERN, self.html) + if m: + wait_time = int(m.group(1)) + 1 self.setWait(wait_time, False) else: wait_time = 0 -- 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/StreamcloudEu.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/StreamcloudEu.py') diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 3cbf015c9..11333640e 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -1,17 +1,20 @@ # -*- coding: utf-8 -*- -from time import sleep import re -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo +from time import sleep + from module.network.HTTPRequest import HTTPRequest +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo class StreamcloudEu(XFileSharingPro): __name__ = "StreamcloudEu" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\S+' __version__ = "0.04" + + __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\S+' + __description__ = """Streamcloud.eu hoster plugin""" __author_name__ = "seoester" __author_mail__ = "seoester@googlemail.com" @@ -20,6 +23,7 @@ class StreamcloudEu(XFileSharingPro): LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.(mp4|flv))",' + def setup(self): super(StreamcloudEu, self).setup() self.multiDL = True -- cgit v1.2.3