From fd105f8e51768ec1943cda2375bdfdbe5b0a3951 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 00:35:51 +0100 Subject: "New Year" Update: hoster plugins --- module/plugins/hoster/GigapetaCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/GigapetaCom.py') diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index 37af7f216..9d3ace3b2 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class GigapetaCom(SimpleHoster): __name__ = "GigapetaCom" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'http://(?:www\.)?gigapeta\.com/dl/\w+' @@ -27,7 +27,7 @@ class GigapetaCom(SimpleHoster): COOKIES = [("gigapeta.com", "lang", "us")] - def handleFree(self): + def handleFree(self, pyfile): captcha_key = str(randint(1, 100000000)) captcha_url = "http://gigapeta.com/img/captcha.gif?x=%s" % captcha_key @@ -37,7 +37,7 @@ class GigapetaCom(SimpleHoster): self.checkErrors() captcha = self.decryptCaptcha(captcha_url) - self.html = self.load(self.pyfile.url, post={ + self.html = self.load(pyfile.url, post={ "captcha_key": captcha_key, "captcha": captcha, "download": "Download"}) -- cgit v1.2.3 From 7d90803262ccbb4fc5296a4dc3ce30fe98f55631 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 25 Mar 2015 23:10:07 +0100 Subject: __config__ cosmetics --- module/plugins/hoster/GigapetaCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/GigapetaCom.py') diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index 9d3ace3b2..bb53a12ee 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -14,6 +14,7 @@ class GigapetaCom(SimpleHoster): __version__ = "0.03" __pattern__ = r'http://(?:www\.)?gigapeta\.com/dl/\w+' + __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """GigaPeta.com hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 1e6846b3c435b0d71be83670d09bd019a84823ec Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 10 Apr 2015 14:36:59 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/GigapetaCom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/GigapetaCom.py') diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index bb53a12ee..2fe44ca85 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -45,7 +45,7 @@ class GigapetaCom(SimpleHoster): 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 + self.link = m.group(1).rstrip() #@TODO: Remove .rstrip() in 0.4.10 break elif "Entered figures don`t coincide with the picture" in self.html: self.invalidCaptcha() @@ -53,7 +53,6 @@ class GigapetaCom(SimpleHoster): self.fail(_("No valid captcha code entered")) self.req.http.c.setopt(FOLLOWLOCATION, 1) - self.download(download_url) def checkErrors(self): -- cgit v1.2.3 From 1ef93e913238275f7657d496ba3d2e7eeb5a30a2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 May 2015 01:06:01 +0200 Subject: Use 'import' instead 'from' --- module/plugins/hoster/GigapetaCom.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/GigapetaCom.py') diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index 2fe44ca85..e4d0601fc 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- +import pycurl +import random import re -from pycurl import FOLLOWLOCATION -from random import randint - from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -29,10 +28,10 @@ class GigapetaCom(SimpleHoster): def handleFree(self, pyfile): - captcha_key = str(randint(1, 100000000)) + captcha_key = str(random.randint(1, 100000000)) captcha_url = "http://gigapeta.com/img/captcha.gif?x=%s" % captcha_key - self.req.http.c.setopt(FOLLOWLOCATION, 0) + self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) for _i in xrange(5): self.checkErrors() @@ -52,7 +51,7 @@ class GigapetaCom(SimpleHoster): else: self.fail(_("No valid captcha code entered")) - self.req.http.c.setopt(FOLLOWLOCATION, 1) + self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) def checkErrors(self): -- cgit v1.2.3 From 14600aa22812176c4f61ffcfd4ae3b0ee62ae368 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 18 May 2015 05:25:09 +0200 Subject: Spare plugins updates --- module/plugins/hoster/GigapetaCom.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'module/plugins/hoster/GigapetaCom.py') diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index e4d0601fc..c2feeb6f8 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class GigapetaCom(SimpleHoster): __name__ = "GigapetaCom" __type__ = "hoster" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'http://(?:www\.)?gigapeta\.com/dl/\w+' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -20,10 +20,12 @@ class GigapetaCom(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - NAME_PATTERN = r'file-->\s*(?P.*?)\s*' - SIZE_PATTERN = r'\s*Size\s*\s*\s*(?P.*?)\s*' + NAME_PATTERN = r'file-->\s*(?P.*?)\s*' + SIZE_PATTERN = r'\s*Size\s*\s*\s*(?P.*?)\s*' OFFLINE_PATTERN = r'
' + DOWNLOAD_PATTERN = r'"All threads for IP' + COOKIES = [("gigapeta.com", "lang", "us")] @@ -54,13 +56,4 @@ class GigapetaCom(SimpleHoster): self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) - def checkErrors(self): - if "All threads for IP" in self.html: - self.logDebug("Your IP is already downloading a file") - self.wait(5 * 60, True) - self.retry() - - self.info.pop('error', None) - - getInfo = create_getInfo(GigapetaCom) -- cgit v1.2.3