summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/GigapetaCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/GigapetaCom.py')
-rw-r--r--module/plugins/hoster/GigapetaCom.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py
index 9d3ace3b2..d12084d42 100644
--- a/module/plugins/hoster/GigapetaCom.py
+++ b/module/plugins/hoster/GigapetaCom.py
@@ -2,10 +2,9 @@
import re
-from pycurl import FOLLOWLOCATION
from random import randint
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from pyload.plugin.internal.SimpleHoster import SimpleHoster, create_getInfo
class GigapetaCom(SimpleHoster):
@@ -31,27 +30,25 @@ class GigapetaCom(SimpleHoster):
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 xrange(5):
self.checkErrors()
captcha = self.decryptCaptcha(captcha_url)
- self.html = self.load(pyfile.url, post={
- "captcha_key": captcha_key,
- "captcha": captcha,
- "download": "Download"})
+ self.html = self.load(pyfile.url,
+ post={'captcha_key': captcha_key,
+ 'captcha' : captcha,
+ 'download' : "Download"},
+ follow_location=False)
m = re.search(r'Location\s*:\s*(.+)', self.req.http.header, re.I)
if m:
- download_url = m.group(1).rstrip() #@TODO: Remove .rstrip() in 0.4.10
+ download_url = m.group(1)
break
elif "Entered figures don`t coincide with the picture" in self.html:
self.invalidCaptcha()
else:
self.fail(_("No valid captcha code entered"))
- self.req.http.c.setopt(FOLLOWLOCATION, 1)
self.download(download_url)