From 93592862b520a862c01f80c019e5c4bc43746c19 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 16:54:20 +0200 Subject: [SimpleHoster] Better inline docs + changed "FILE_OFFLINE_PATTERN" to "OFFLINE_PATTERN" --- module/plugins/hoster/GigapetaCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/GigapetaCom.py') diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index 1282c996d..f34af0413 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -36,7 +36,7 @@ class GigapetaCom(SimpleHoster): SH_COOKIES = [("http://gigapeta.com", "lang", "us")] FILE_NAME_PATTERN = r'file-->\s*(?P.*?)\s*' FILE_SIZE_PATTERN = r'\s*Size\s*\s*\s*(?P.*?)\s*' - FILE_OFFLINE_PATTERN = r'
' + OFFLINE_PATTERN = r'
' def handleFree(self): captcha_key = str(randint(1, 100000000)) -- cgit v1.2.3 From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hoster/GigapetaCom.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/GigapetaCom.py') diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index f34af0413..bda11fc6f 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: zoidberg """ import re -- cgit v1.2.3 From a9f81c043c62abcb3ce38971237693736833fdbe Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:28:23 +0200 Subject: Fix hosters SH_COOKIES syntax --- module/plugins/hoster/GigapetaCom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/GigapetaCom.py') diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index bda11fc6f..566d044b4 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -31,11 +31,13 @@ class GigapetaCom(SimpleHoster): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - SH_COOKIES = [("http://gigapeta.com", "lang", "us")] FILE_NAME_PATTERN = r'file-->\s*(?P.*?)\s*' FILE_SIZE_PATTERN = r'\s*Size\s*\s*\s*(?P.*?)\s*' OFFLINE_PATTERN = r'
' + SH_COOKIES = [(".gigapeta.com", "lang", "us")] + + def handleFree(self): captcha_key = str(randint(1, 100000000)) captcha_url = "http://gigapeta.com/img/captcha.gif?x=%s" % captcha_key -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- 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 566d044b4..9d9825cb8 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -53,9 +53,9 @@ class GigapetaCom(SimpleHoster): "captcha": captcha, "download": "Download"}) - found = re.search(r"Location\s*:\s*(.*)", self.req.http.header, re.I) - if found: - download_url = found.group(1) + m = re.search(r"Location\s*:\s*(.*)", self.req.http.header, re.I) + if m: + download_url = m.group(1) break elif "Entered figures don`t coincide with the picture" in self.html: self.invalidCaptcha() -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/GigapetaCom.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'module/plugins/hoster/GigapetaCom.py') diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index 9d9825cb8..966ac8094 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -1,23 +1,9 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - import re -from random import randint + from pycurl import FOLLOWLOCATION +from random import randint from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -25,8 +11,10 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class GigapetaCom(SimpleHoster): __name__ = "GigapetaCom" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?gigapeta\.com/dl/\w+' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?gigapeta\.com/dl/\w+' + __description__ = """GigaPeta.com hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" -- cgit v1.2.3