diff options
author | Stefano <l.stickell@yahoo.it> | 2013-07-22 20:50:34 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-07-22 20:50:34 +0200 |
commit | 2edeee0532ec6d6b4b26fd045a5971f67ca455da (patch) | |
tree | 8d656afc9c18f7dba7c05d6635f898fdf58d66d6 /module/plugins/hoster/UnibytesCom.py | |
parent | Fixed PEP 8 violations in Crypters (diff) | |
download | pyload-2edeee0532ec6d6b4b26fd045a5971f67ca455da.tar.xz |
Fixed PEP 8 violations in Hosters
Diffstat (limited to 'module/plugins/hoster/UnibytesCom.py')
-rw-r--r-- | module/plugins/hoster/UnibytesCom.py | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index 3c8552271..d13f01ef3 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/plugins/hoster/UnibytesCom.py @@ -20,6 +20,7 @@ import re from pycurl import FOLLOWLOCATION from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + class UnibytesCom(SimpleHoster): __name__ = "UnibytesCom" __type__ = "hoster" @@ -30,28 +31,28 @@ class UnibytesCom(SimpleHoster): FILE_INFO_PATTERN = r'<span[^>]*?id="fileName"[^>]*>(?P<N>[^>]+)</span>\s*\((?P<S>\d.*?)\)' DOMAIN = 'http://www.unibytes.com' - + WAIT_PATTERN = r'Wait for <span id="slowRest">(\d+)</span> sec' DOWNLOAD_LINK_PATTERN = r'<a href="([^"]+)">Download</a>' def handleFree(self): - action, post_data = self.parseHtmlForm('id="startForm"') + action, post_data = self.parseHtmlForm('id="startForm"') self.req.http.c.setopt(FOLLOWLOCATION, 0) - + for i in range(8): self.logDebug(action, post_data) - self.html = self.load(self.DOMAIN + action, post = post_data) - + self.html = self.load(self.DOMAIN + action, post=post_data) + found = re.search(r'location:\s*(\S+)', self.req.http.header, re.I) if found: url = found.group(1) break - - if '>Somebody else is already downloading using your IP-address<' in self.html: + + if '>Somebody else is already downloading using your IP-address<' in self.html: self.setWait(600, True) self.wait() self.retry() - + if post_data['step'] == 'last': found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) if found: @@ -60,21 +61,22 @@ class UnibytesCom(SimpleHoster): break else: self.invalidCaptcha() - - last_step = post_data['step'] + + last_step = post_data['step'] action, post_data = self.parseHtmlForm('id="stepForm"') - - if last_step == 'timer': + + if last_step == 'timer': found = re.search(self.WAIT_PATTERN, self.html) self.setWait(int(found.group(1)) if found else 60, False) - self.wait() + self.wait() elif last_step in ('captcha', 'last'): post_data['captcha'] = self.decryptCaptcha(self.DOMAIN + '/captcha.jpg') else: - self.fail("No valid captcha code entered") - + self.fail("No valid captcha code entered") + self.logDebug('Download link: ' + url) - self.req.http.c.setopt(FOLLOWLOCATION, 1) - self.download(url) + self.req.http.c.setopt(FOLLOWLOCATION, 1) + self.download(url) + -getInfo = create_getInfo(UnibytesCom)
\ No newline at end of file +getInfo = create_getInfo(UnibytesCom) |