summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hoster/GigapetaCom.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-07-22 20:50:34 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-07-22 21:20:06 +0200
commitaaaf5a4cddec894aacd7400c59a9f2f5e710362f (patch)
tree9d9e89aff86598b3ffcc86117abd554b193e28b5 /pyload/plugins/hoster/GigapetaCom.py
parentimplemented media type filter (diff)
downloadpyload-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/GigapetaCom.py')
-rw-r--r--pyload/plugins/hoster/GigapetaCom.py41
1 files changed, 22 insertions, 19 deletions
diff --git a/pyload/plugins/hoster/GigapetaCom.py b/pyload/plugins/hoster/GigapetaCom.py
index 28ba35abe..de5d94513 100644
--- a/pyload/plugins/hoster/GigapetaCom.py
+++ b/pyload/plugins/hoster/GigapetaCom.py
@@ -18,9 +18,11 @@
import re
from random import randint
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from pycurl import FOLLOWLOCATION
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
class GigapetaCom(SimpleHoster):
__name__ = "GigapetaCom"
__type__ = "hoster"
@@ -34,40 +36,41 @@ class GigapetaCom(SimpleHoster):
FILE_NAME_PATTERN = r'<img src=".*" alt="file" />-->\s*(?P<N>.*?)\s*</td>'
FILE_SIZE_PATTERN = r'<th>\s*Size\s*</th>\s*<td>\s*(?P<S>.*?)\s*</td>'
FILE_OFFLINE_PATTERN = r'<div id="page_error">'
-
- def handleFree(self):
- captcha_key = str(randint(1,100000000))
+
+ def handleFree(self):
+ captcha_key = str(randint(1, 100000000))
captcha_url = "http://gigapeta.com/img/captcha.gif?x=%s" % captcha_key
-
+
self.req.http.c.setopt(FOLLOWLOCATION, 0)
-
+
for i in range(5):
self.checkErrors()
-
- captcha = self.decryptCaptcha(captcha_url)
- self.html = self.load(self.pyfile.url, post = {
- "captcha_key": captcha_key,
+
+ captcha = self.decryptCaptcha(captcha_url)
+ self.html = self.load(self.pyfile.url, post={
+ "captcha_key": captcha_key,
"captcha": captcha,
"download": "Download"})
-
+
found = re.search(r"Location\s*:\s*(.*)", self.req.http.header, re.I)
if found:
- download_url = found.group(1)
- break
+ download_url = found.group(1)
+ break
elif "Entered figures don&#96;t coincide with the picture" in self.html:
- self.invalidCaptcha()
+ self.invalidCaptcha()
else:
- self.fail("No valid captcha code entered")
-
+ self.fail("No valid captcha code entered")
+
self.req.http.c.setopt(FOLLOWLOCATION, 1)
self.logDebug("Download URL: %s" % download_url)
self.download(download_url)
-
+
def checkErrors(self):
if "All threads for IP" in self.html:
self.logDebug("Your IP is already downloading a file - wait and retry")
self.setWait(300, True)
self.wait()
self.retry()
-
-getInfo = create_getInfo(GigapetaCom) \ No newline at end of file
+
+
+getInfo = create_getInfo(GigapetaCom)