From aaaf5a4cddec894aacd7400c59a9f2f5e710362f Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 22 Jul 2013 20:50:34 +0200 Subject: Fixed PEP 8 violations in Hosters (cherry picked from commit 2edeee0532ec6d6b4b26fd045a5971f67ca455da) Conflicts: pyload/plugins/hoster/BasePlugin.py pyload/plugins/hoster/MultishareCz.py pyload/plugins/hoster/NetloadIn.py pyload/plugins/hoster/PremiumizeMe.py pyload/plugins/hoster/RapidshareCom.py --- pyload/plugins/hoster/UnibytesCom.py | 38 +++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'pyload/plugins/hoster/UnibytesCom.py') diff --git a/pyload/plugins/hoster/UnibytesCom.py b/pyload/plugins/hoster/UnibytesCom.py index 3c8552271..d13f01ef3 100644 --- a/pyload/plugins/hoster/UnibytesCom.py +++ b/pyload/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']*?id="fileName"[^>]*>(?P[^>]+)\s*\((?P\d.*?)\)' DOMAIN = 'http://www.unibytes.com' - + WAIT_PATTERN = r'Wait for (\d+) sec' DOWNLOAD_LINK_PATTERN = r'Download' 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) -- cgit v1.2.3