From c59aa4057608cd47084c66e41f363b5f981f2816 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 8 Oct 2015 12:24:34 +0200 Subject: Fixpack (5) --- module/plugins/hoster/GigapetaCom.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'module/plugins/hoster/GigapetaCom.py') diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index 85e5e4843..da2f82f8f 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -34,26 +34,16 @@ class GigapetaCom(SimpleHoster): captcha_key = str(random.randint(1, 100000000)) captcha_url = "http://gigapeta.com/img/captcha.gif?x=%s" % captcha_key - self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) - self.check_errors() captcha = self.captcha.decrypt(captcha_url) - self.html = self.load(pyfile.url, post={ - 'captcha_key': captcha_key, - 'captcha': captcha, - 'download': "Download"}) - - m = re.search(r'Location\s*:\s*(.+)', self.req.http.header, re.I) - if m is not None: - self.captcha.correct() - self.link = m.group(1) - - elif "Entered figures don`t coincide with the picture" in self.html: - self.retry_captcha() - + header = self.load(pyfile.url, + post={'captcha_key': captcha_key, + 'captcha' : captcha, + 'download' : "Download"}, + just_header=True) - self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) + self.link = header.get('location') getInfo = create_getInfo(GigapetaCom) -- cgit v1.2.3