diff options
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/GigapetaCom.py | 8 | ||||
-rw-r--r-- | module/plugins/hoster/QuickshareCz.py | 6 | ||||
-rw-r--r-- | module/plugins/hoster/StreamcloudEu.py | 99 |
3 files changed, 8 insertions, 105 deletions
diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index 8e5d184c9..111493338 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class GigapetaCom(SimpleHoster): __name__ = "GigapetaCom" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.02" __pattern__ = r'http://(?:www\.)?gigapeta\.com/dl/\w+' @@ -42,9 +42,9 @@ class GigapetaCom(SimpleHoster): "captcha": captcha, "download": "Download"}) - m = re.search(r"Location\s*:\s*(.*)", self.req.http.header, re.I) + m = re.search(r'Location\s*:\s*(.+)', self.req.http.header, re.I) if m: - download_url = m.group(1) + download_url = m.group(1).rstrip() #@TODO: Remove .rstrip() in 0.4.10 break elif "Entered figures don`t coincide with the picture" in self.html: self.invalidCaptcha() @@ -57,7 +57,7 @@ class GigapetaCom(SimpleHoster): def checkErrors(self): if "All threads for IP" in self.html: - self.logDebug("Your IP is already downloading a file - wait and retry") + self.logDebug("Your IP is already downloading a file") self.wait(5 * 60, True) self.retry() diff --git a/module/plugins/hoster/QuickshareCz.py b/module/plugins/hoster/QuickshareCz.py index 028f25102..e1e803e66 100644 --- a/module/plugins/hoster/QuickshareCz.py +++ b/module/plugins/hoster/QuickshareCz.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class QuickshareCz(SimpleHoster): __name__ = "QuickshareCz" __type__ = "hoster" - __version__ = "0.54" + __version__ = "0.55" __pattern__ = r'http://(?:[^/]*\.)?quickshare\.cz/stahnout-soubor/.*' @@ -65,10 +65,10 @@ class QuickshareCz(SimpleHoster): self.header = self.req.http.header self.req.http.c.setopt(FOLLOWLOCATION, 1) - m = re.search("Location\s*:\s*(.*)", self.header, re.I) + m = re.search(r'Location\s*:\s*(.+)', self.header, re.I) if m is None: self.fail(_("File not found")) - download_url = m.group(1) + download_url = m.group(1).rstrip() #@TODO: Remove .rstrip() in 0.4.10 self.logDebug("FREE URL2:" + download_url) # check errors 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) |