diff options
author | Stefano <l.stickell@yahoo.it> | 2013-07-22 20:50:34 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-07-22 21:20:06 +0200 |
commit | aaaf5a4cddec894aacd7400c59a9f2f5e710362f (patch) | |
tree | 9d9e89aff86598b3ffcc86117abd554b193e28b5 /pyload/plugins/hoster/UploadheroCom.py | |
parent | implemented media type filter (diff) | |
download | pyload-aaaf5a4cddec894aacd7400c59a9f2f5e710362f.tar.xz |
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
Diffstat (limited to 'pyload/plugins/hoster/UploadheroCom.py')
-rw-r--r-- | pyload/plugins/hoster/UploadheroCom.py | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/pyload/plugins/hoster/UploadheroCom.py b/pyload/plugins/hoster/UploadheroCom.py index 65d6cc4e9..79bca748e 100644 --- a/pyload/plugins/hoster/UploadheroCom.py +++ b/pyload/plugins/hoster/UploadheroCom.py @@ -22,6 +22,7 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + class UploadheroCom(SimpleHoster): __name__ = "UploadheroCom" __type__ = "hoster" @@ -35,26 +36,27 @@ class UploadheroCom(SimpleHoster): FILE_NAME_PATTERN = r'<div class="nom_de_fichier">(?P<N>.*?)</div>' FILE_SIZE_PATTERN = r'Taille du fichier : </span><strong>(?P<S>.*?)</strong>' FILE_OFFLINE_PATTERN = r'<p class="titre_dl_2">|<div class="raison"><strong>Le lien du fichier ci-dessus n\'existe plus.' - + DOWNLOAD_URL_PATTERN = r'<a href="([^"]+)" id="downloadnow"' - + IP_BLOCKED_PATTERN = r'href="(/lightbox_block_download.php\?min=.*?)"' IP_WAIT_PATTERN = r'<span id="minutes">(\d+)</span>.*\s*<span id="seconds">(\d+)</span>' CAPTCHA_PATTERN = r'"(/captchadl\.php\?[a-z0-9]+)"' FREE_URL_PATTERN = r'var magicomfg = \'<a href="(http://[^<>"]*?)"|"(http://storage\d+\.uploadhero\.com/\?d=[A-Za-z0-9]+/[^<>"/]+)"' - + def handleFree(self): - self.checkErrors() - + self.checkErrors() + found = re.search(self.CAPTCHA_PATTERN, self.html) - if not found: self.parseError("Captcha URL") + if not found: + self.parseError("Captcha URL") captcha_url = "http://uploadhero.com" + found.group(1) - + for i in range(5): - captcha = self.decryptCaptcha(captcha_url) - self.html = self.load(self.pyfile.url, get = {"code": captcha}) - found = re.search(self.FREE_URL_PATTERN, self.html) + captcha = self.decryptCaptcha(captcha_url) + self.html = self.load(self.pyfile.url, get={"code": captcha}) + found = re.search(self.FREE_URL_PATTERN, self.html) if found: self.correctCaptcha() download_url = found.group(1) or found.group(2) @@ -62,26 +64,27 @@ class UploadheroCom(SimpleHoster): else: self.invalidCaptcha() else: - self.fail("No valid captcha code entered") - + self.fail("No valid captcha code entered") + self.download(download_url) - + def handlePremium(self): self.logDebug("%s: Use Premium Account" % self.__name__) self.html = self.load(self.pyfile.url) link = re.search(self.DOWNLOAD_URL_PATTERN, self.html).group(1) self.logDebug("Downloading link : '%s'" % link) - self.download(link) - + self.download(link) + def checkErrors(self): found = re.search(self.IP_BLOCKED_PATTERN, self.html) if found: self.html = self.load("http://uploadhero.com%s" % found.group(1)) - + found = re.search(self.IP_WAIT_PATTERN, self.html) wait_time = (int(found.group(1)) * 60 + int(found.group(2))) if found else 300 self.setWait(wait_time, True) self.wait() self.retry() - + + getInfo = create_getInfo(UploadheroCom) |