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 From 390f7deca39ba14f698b3c56660eee2a5502b79a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 28 Sep 2014 16:50:29 +0200 Subject: Cleaned-up XFileSharingPro based plugins --- module/plugins/hoster/StreamcloudEu.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/StreamcloudEu.py') diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 11333640e..98ca0a19d 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -13,20 +13,23 @@ class StreamcloudEu(XFileSharingPro): __type__ = "hoster" __version__ = "0.04" - __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\S+' + __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\w{12}' __description__ = """Streamcloud.eu hoster plugin""" __author_name__ = "seoester" __author_mail__ = "seoester@googlemail.com" + HOSTER_NAME = "streamcloud.eu" LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.(mp4|flv))",' def setup(self): - super(StreamcloudEu, self).setup() self.multiDL = True + self.chunkLimit = 1 + self.resumeDownload = self.premium + def getDownloadLink(self): m = re.search(self.LINK_PATTERN, self.html, re.S) @@ -58,6 +61,7 @@ class StreamcloudEu(XFileSharingPro): return m.group(1) + def getPostParameters(self): for i in xrange(3): if not self.errmsg: -- 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/StreamcloudEu.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/StreamcloudEu.py') diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 98ca0a19d..faf267dc0 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -16,8 +16,7 @@ class StreamcloudEu(XFileSharingPro): __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\w{12}' __description__ = """Streamcloud.eu hoster plugin""" - __author_name__ = "seoester" - __author_mail__ = "seoester@googlemail.com" + __authors__ = [("seoester", "seoester@googlemail.com")] HOSTER_NAME = "streamcloud.eu" -- cgit v1.2.3 From 60320d4addec35b9cbd14a05b6c33fba63d6c620 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 16:14:33 +0200 Subject: Update plugins XFileSharingPro based --- 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 faf267dc0..e61cb5dd2 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -5,13 +5,13 @@ import re from time import sleep from module.network.HTTPRequest import HTTPRequest -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo +from module.plugins.hoster.XFSPHoster import XFSPHoster, create_getInfo -class StreamcloudEu(XFileSharingPro): +class StreamcloudEu(XFSPHoster): __name__ = "StreamcloudEu" __type__ = "hoster" - __version__ = "0.04" + __version__ = "0.05" __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\w{12}' -- cgit v1.2.3 From 355c80c5e456f22a4fd3247985710a46a43a79f9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 19:51:40 +0200 Subject: Fix previous plugins update --- module/plugins/hoster/StreamcloudEu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/StreamcloudEu.py') diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index e61cb5dd2..6adace633 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -5,13 +5,13 @@ import re from time import sleep from module.network.HTTPRequest import HTTPRequest -from module.plugins.hoster.XFSPHoster import XFSPHoster, create_getInfo +from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo class StreamcloudEu(XFSPHoster): __name__ = "StreamcloudEu" __type__ = "hoster" - __version__ = "0.05" + __version__ = "0.06" __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\w{12}' -- 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/StreamcloudEu.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/StreamcloudEu.py') diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 6adace633..1df5ca13c 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -16,6 +16,7 @@ class StreamcloudEu(XFSPHoster): __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\w{12}' __description__ = """Streamcloud.eu hoster plugin""" + __license__ = "GPLv3" __authors__ = [("seoester", "seoester@googlemail.com")] -- 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/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 1df5ca13c..e6a2b0226 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -22,7 +22,7 @@ class StreamcloudEu(XFSPHoster): HOSTER_NAME = "streamcloud.eu" - 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): -- cgit v1.2.3 From 2ae91b81a2f12a1c9b1f78524df78a2b3f1ef494 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Oct 2014 14:52:42 +0200 Subject: Update hosters to self.error --- 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 e6a2b0226..49820bae6 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -11,7 +11,7 @@ from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo class StreamcloudEu(XFSPHoster): __name__ = "StreamcloudEu" __type__ = "hoster" - __version__ = "0.06" + __version__ = "0.07" __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\w{12}' @@ -78,7 +78,7 @@ class StreamcloudEu(XFSPHoster): if self.errmsg: self.retry() else: - self.parseError("Form not found") + self.error("Form not found") self.logDebug(self.HOSTER_NAME, inputs) @@ -122,7 +122,7 @@ class StreamcloudEu(XFSPHoster): self.errmsg = None else: - self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) + self.error('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) getInfo = create_getInfo(StreamcloudEu) -- cgit v1.2.3 From e3f5280529921100f48bb8a79853bf480c7611e4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 02:53:05 +0200 Subject: Replace single quotes with doubles in self.error and self.fail msg --- 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 49820bae6..11a402bfd 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -122,7 +122,7 @@ class StreamcloudEu(XFSPHoster): self.errmsg = None else: - self.error('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) + self.error("FORM: %s" % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) getInfo = create_getInfo(StreamcloudEu) -- 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/StreamcloudEu.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/StreamcloudEu.py') diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 11a402bfd..24b0ebfae 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -55,9 +55,9 @@ class StreamcloudEu(XFSPHoster): else: if self.errmsg and 'captcha' in self.errmsg: - self.fail("No valid captcha code entered") + self.fail(_("No valid captcha code entered")) else: - self.fail("Download link not found") + self.fail(_("Download link not found")) return m.group(1) @@ -78,7 +78,7 @@ class StreamcloudEu(XFSPHoster): if self.errmsg: self.retry() else: - self.error("Form not found") + self.error(_("Form not found")) self.logDebug(self.HOSTER_NAME, inputs) @@ -87,7 +87,7 @@ class StreamcloudEu(XFSPHoster): if self.passwords: inputs['password'] = self.passwords.pop(0) else: - self.fail("No or invalid passport") + self.fail(_("No or invalid passport")) if not self.premium: m = re.search(self.WAIT_PATTERN, self.html) @@ -122,7 +122,7 @@ class StreamcloudEu(XFSPHoster): self.errmsg = None else: - self.error("FORM: %s" % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) + self.error(_("FORM: %s") % (inputs['op'] if 'op' in inputs else _("UNKNOWN"))) getInfo = create_getInfo(StreamcloudEu) -- cgit v1.2.3 From 8b3589dd394d81177bf4680dddb5bdb9506b89ea Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:04:10 +0100 Subject: Update plugins to last changes --- 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 24b0ebfae..ec006aeb2 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -92,7 +92,7 @@ class StreamcloudEu(XFSPHoster): if not self.premium: m = re.search(self.WAIT_PATTERN, self.html) if m: - wait_time = int(m.group(1)) + 1 + wait_time = int(m.group(1)) self.setWait(wait_time, False) else: wait_time = 0 -- 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/StreamcloudEu.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/StreamcloudEu.py') diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index ec006aeb2..3fd29822f 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -9,15 +9,15 @@ from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo class StreamcloudEu(XFSPHoster): - __name__ = "StreamcloudEu" - __type__ = "hoster" + __name__ = "StreamcloudEu" + __type__ = "hoster" __version__ = "0.07" __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\w{12}' __description__ = """Streamcloud.eu hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("seoester", "seoester@googlemail.com")] + __license__ = "GPLv3" + __authors__ = [("seoester", "seoester@googlemail.com")] HOSTER_NAME = "streamcloud.eu" -- 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/StreamcloudEu.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/StreamcloudEu.py') diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 3fd29822f..a6f34a34a 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -5,13 +5,13 @@ import re from time import sleep from module.network.HTTPRequest import HTTPRequest -from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo +from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo -class StreamcloudEu(XFSPHoster): +class StreamcloudEu(XFSHoster): __name__ = "StreamcloudEu" __type__ = "hoster" - __version__ = "0.07" + __version__ = "0.08" __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\w{12}' @@ -20,7 +20,7 @@ class StreamcloudEu(XFSPHoster): __authors__ = [("seoester", "seoester@googlemail.com")] - HOSTER_NAME = "streamcloud.eu" + HOSTER_DOMAIN = "streamcloud.eu" LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud\.eu:?\d*/.*/video\.(mp4|flv))",' @@ -80,7 +80,7 @@ class StreamcloudEu(XFSPHoster): else: self.error(_("Form not found")) - self.logDebug(self.HOSTER_NAME, inputs) + self.logDebug(inputs) if 'op' in inputs and inputs['op'] in ("download1", "download2", "download3"): if "password" in inputs: -- cgit v1.2.3 From 58c9c8d78417ec6ccac5b6b117ea540033a09574 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 7 Nov 2014 17:08:21 +0100 Subject: Fix download link formatting in some plugins --- module/plugins/hoster/StreamcloudEu.py | 99 +--------------------------------- 1 file changed, 1 insertion(+), 98 deletions(-) (limited to 'module/plugins/hoster/StreamcloudEu.py') diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index a6f34a34a..4f854a99d 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -2,16 +2,13 @@ import re -from time import sleep - -from module.network.HTTPRequest import HTTPRequest from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class StreamcloudEu(XFSHoster): __name__ = "StreamcloudEu" __type__ = "hoster" - __version__ = "0.08" + __version__ = "0.09" __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\w{12}' @@ -31,98 +28,4 @@ class StreamcloudEu(XFSHoster): self.resumeDownload = self.premium - def getDownloadLink(self): - 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) - data = self.getPostParameters() - httpRequest = HTTPRequest(options=self.req.options) - httpRequest.cj = self.req.cj - sleep(10) - self.html = httpRequest.load(self.pyfile.url, post=data, referer=False, cookies=True, decode=True) - self.header = httpRequest.header - - m = re.search("Location\s*:\s*(.*)", self.header, re.I) - if m: - break - - m = re.search(self.LINK_PATTERN, self.html, re.S) - if m: - break - - else: - if self.errmsg and 'captcha' in self.errmsg: - self.fail(_("No valid captcha code entered")) - else: - self.fail(_("Download link not found")) - - return m.group(1) - - - def getPostParameters(self): - for i in xrange(3): - if not self.errmsg: - self.checkErrors() - - if hasattr(self, "FORM_PATTERN"): - action, inputs = self.parseHtmlForm(self.FORM_PATTERN) - else: - action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")}) - - if not inputs: - action, inputs = self.parseHtmlForm('F1') - if not inputs: - if self.errmsg: - self.retry() - else: - self.error(_("Form not found")) - - self.logDebug(inputs) - - if 'op' in inputs and inputs['op'] in ("download1", "download2", "download3"): - if "password" in inputs: - if self.passwords: - inputs['password'] = self.passwords.pop(0) - else: - self.fail(_("No or invalid passport")) - - if not self.premium: - m = re.search(self.WAIT_PATTERN, self.html) - if m: - wait_time = int(m.group(1)) - self.setWait(wait_time, False) - else: - wait_time = 0 - - self.captcha = self.handleCaptcha(inputs) - - if wait_time: - self.wait() - - self.errmsg = None - self.logDebug("getPostParameters {0}".format(i)) - return inputs - - else: - inputs['referer'] = self.pyfile.url - - if self.premium: - inputs['method_premium'] = "Premium Download" - if 'method_free' in inputs: - del inputs['method_free'] - else: - inputs['method_free'] = "Free Download" - if 'method_premium' in inputs: - del inputs['method_premium'] - - self.html = self.load(self.pyfile.url, post=inputs, ref=False) - self.errmsg = None - - else: - self.error(_("FORM: %s") % (inputs['op'] if 'op' in inputs else _("UNKNOWN"))) - - getInfo = create_getInfo(StreamcloudEu) -- cgit v1.2.3