From 08ee77db1b3ec0cd42e40e35c07c6c3882d940bf Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:31:21 +0200 Subject: [CaptchaService] Remove SolveMedia __init__ --- module/plugins/internal/CaptchaService.py | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'module/plugins/internal/CaptchaService.py') diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index 400484d26..30f9e8d14 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -1,28 +1,11 @@ # -*- 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 . - - @author: zoidberg -""" - import re from random import random class CaptchaService(): - __version__ = "0.04" + __version__ = "0.05" def __init__(self, plugin): self.plugin = plugin @@ -88,9 +71,6 @@ class AdsCaptcha(CaptchaService): class SolveMedia(CaptchaService): - def __init__(self, plugin): - self.plugin = plugin - def challenge(self, src): html = self.plugin.req.load("http://api.solvemedia.com/papi/challenge.noscript?k=%s" % src, cookies=True) try: -- 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/internal/CaptchaService.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'module/plugins/internal/CaptchaService.py') diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index 30f9e8d14..c2c66ed31 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -5,8 +5,14 @@ from random import random class CaptchaService(): + __name__ = "CaptchaService" __version__ = "0.05" + __description__ = """Captcha service plugin""" + __author_name__ = "pyLoad Team" + __author_mail__ = "admin@pyload.org" + + def __init__(self, plugin): self.plugin = plugin @@ -17,6 +23,7 @@ class ReCaptcha(): recaptcha_key = None + def __init__(self, plugin): self.plugin = plugin -- cgit v1.2.3 From 31449f9e22cf4b5ae0f147a46bcbbf6f53a098a5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:27:08 +0200 Subject: Fix class definition --- module/plugins/internal/CaptchaService.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/internal/CaptchaService.py') diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index c2c66ed31..b2f73e4ea 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -4,7 +4,7 @@ import re from random import random -class CaptchaService(): +class CaptchaService: __name__ = "CaptchaService" __version__ = "0.05" @@ -17,7 +17,7 @@ class CaptchaService(): self.plugin = plugin -class ReCaptcha(): +class ReCaptcha: RECAPTCHA_KEY_PATTERN = r"https?://(?:www\.)?google\.com/recaptcha/api/challenge\?k=(?P\w+)" RECAPTCHA_KEY_AJAX_PATTERN = r"Recaptcha\.create\s*\(\s*[\"'](?P\w+)[\"']\s*," -- cgit v1.2.3 From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/internal/CaptchaService.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/internal/CaptchaService.py') diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index b2f73e4ea..d8306bbb7 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -60,6 +60,7 @@ class ReCaptcha: class AdsCaptcha(CaptchaService): + def challenge(self, src): js = self.plugin.req.load(src, cookies=True) -- cgit v1.2.3 From 8e47b0de30a25d0fd5dfb518bfe4e1e7beff93fd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/internal/CaptchaService.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/internal/CaptchaService.py') diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index d8306bbb7..6586256f7 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -79,6 +79,7 @@ class AdsCaptcha(CaptchaService): class SolveMedia(CaptchaService): + def challenge(self, src): html = self.plugin.req.load("http://api.solvemedia.com/papi/challenge.noscript?k=%s" % src, cookies=True) try: -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/internal/CaptchaService.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/CaptchaService.py') diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index 6586256f7..d325d7928 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -29,7 +29,7 @@ class ReCaptcha: def detect_key(self, html): m = re.search(self.RECAPTCHA_KEY_PATTERN, html) - if not m: + if m is None: m = re.search(self.RECAPTCHA_KEY_AJAX_PATTERN, html) if m: self.recaptcha_key = m.group('key') @@ -38,9 +38,9 @@ class ReCaptcha: return None def challenge(self, key=None): - if not key and self.recaptcha_key: + if key is None and self.recaptcha_key: key = self.recaptcha_key - elif not (key or self.recaptcha_key): + else: raise TypeError("ReCaptcha key not found") js = self.plugin.req.load("http://www.google.com/recaptcha/api/challenge", get={"k": key}, cookies=True) -- 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/internal/CaptchaService.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/internal/CaptchaService.py') diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index d325d7928..b247ba654 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re + from random import random -- cgit v1.2.3