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/UptoboxCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UptoboxCom.py') diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py index e403425c1..f086a9bc0 100644 --- a/module/plugins/hoster/UptoboxCom.py +++ b/module/plugins/hoster/UptoboxCom.py @@ -36,7 +36,7 @@ class UptoboxCom(XFileSharingPro): HOSTER_NAME = "uptobox.com" FILE_INFO_PATTERN = r'"para_title">(?P.+) \((?P[\d\.]+) (?P\w+)\)' - FILE_OFFLINE_PATTERN = r'>(File not found|Access Denied|404 Not Found)' + OFFLINE_PATTERN = r'>(File not found|Access Denied|404 Not Found)' TEMP_OFFLINE_PATTERN = r'>This server is in maintenance mode' WAIT_PATTERN = r'>(\d+) seconds<' -- cgit v1.2.3 From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/hoster/UptoboxCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UptoboxCom.py') diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py index f086a9bc0..802b84bbf 100644 --- a/module/plugins/hoster/UptoboxCom.py +++ b/module/plugins/hoster/UptoboxCom.py @@ -41,7 +41,7 @@ class UptoboxCom(XFileSharingPro): WAIT_PATTERN = r'>(\d+) seconds<' - DIRECT_LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"' + LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"' def handleCaptcha(self, inputs): found = re.search(self.SOLVEMEDIA_PATTERN, self.html) -- 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/UptoboxCom.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/UptoboxCom.py') diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py index 802b84bbf..cdb0d00ac 100644 --- a/module/plugins/hoster/UptoboxCom.py +++ b/module/plugins/hoster/UptoboxCom.py @@ -12,8 +12,6 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -# -# @author: Walter Purcaro ############################################################################### import re -- 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/UptoboxCom.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'module/plugins/hoster/UptoboxCom.py') diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py index cdb0d00ac..20a2d675a 100644 --- a/module/plugins/hoster/UptoboxCom.py +++ b/module/plugins/hoster/UptoboxCom.py @@ -42,22 +42,22 @@ class UptoboxCom(XFileSharingPro): LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"' def handleCaptcha(self, inputs): - found = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if found: - captcha_key = found.group(1) + m = re.search(self.SOLVEMEDIA_PATTERN, self.html) + if m: + captcha_key = m.group(1) captcha = SolveMedia(self) inputs['adcopy_challenge'], inputs['adcopy_response'] = captcha.challenge(captcha_key) return 4 else: - found = re.search(self.CAPTCHA_URL_PATTERN, self.html) - if found: - captcha_url = found.group(1) + m = re.search(self.CAPTCHA_URL_PATTERN, self.html) + if m: + captcha_url = m.group(1) inputs['code'] = self.decryptCaptcha(captcha_url) return 2 else: - found = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.DOTALL) - if found: - captcha_div = found.group(1) + m = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.DOTALL) + if m: + captcha_div = m.group(1) self.logDebug(captcha_div) numerals = re.findall(r'(\d)', html_unescape(captcha_div)) @@ -65,9 +65,9 @@ class UptoboxCom(XFileSharingPro): self.logDebug("CAPTCHA", inputs['code'], numerals) return 3 else: - found = re.search(self.RECAPTCHA_URL_PATTERN, self.html) - if found: - recaptcha_key = unquote(found.group(1)) + m = re.search(self.RECAPTCHA_URL_PATTERN, self.html) + if m: + recaptcha_key = unquote(m.group(1)) self.logDebug("RECAPTCHA KEY: %s" % recaptcha_key) recaptcha = ReCaptcha(self) inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge( -- 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/UptoboxCom.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'module/plugins/hoster/UptoboxCom.py') diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py index 20a2d675a..6d86c5559 100644 --- a/module/plugins/hoster/UptoboxCom.py +++ b/module/plugins/hoster/UptoboxCom.py @@ -1,20 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################### -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -############################################################################### import re + from urllib import unquote from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo @@ -25,8 +12,10 @@ from module.utils import html_unescape class UptoboxCom(XFileSharingPro): __name__ = "UptoboxCom" __type__ = "hoster" - __pattern__ = r'https?://(?:www\.)?uptobox\.com/\w+' __version__ = "0.09" + + __pattern__ = r'https?://(?:www\.)?uptobox\.com/\w+' + __description__ = """Uptobox.com hoster plugin""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" @@ -41,6 +30,7 @@ class UptoboxCom(XFileSharingPro): LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"' + def handleCaptcha(self, inputs): m = re.search(self.SOLVEMEDIA_PATTERN, self.html) if m: -- cgit v1.2.3