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/IfileIt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 6c754624b..64dac7d13 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -37,7 +37,7 @@ class IfileIt(SimpleHoster): DOWNLOAD_LINK_PATTERN = r' If it doesn\'t, ' RECAPTCHA_KEY_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" FILE_INFO_PATTERN = r']*>\s* \s*\s*\s*' + OFFLINE_PATTERN = r'Downloading of this file is temporarily disabled' def handleFree(self): -- 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/IfileIt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 64dac7d13..41c0cd5cc 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -33,8 +33,8 @@ class IfileIt(SimpleHoster): __author_mail__ = "zoidberg@mujmail.cz" #EVAL_PATTERN = r'(eval\(function\(p,a,c,k,e,d\).*)' - #DEC_PATTERN = r"requestBtn_clickEvent[^}]*url:\s*([^,]+)" - DOWNLOAD_LINK_PATTERN = r' If it doesn\'t, ' + #DEC_PATTERN = r'requestBtn_clickEvent[^}]*url:\s*([^,]+)' + LINK_PATTERN = r' If it doesn\'t, ' RECAPTCHA_KEY_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" FILE_INFO_PATTERN = r']*>\s* \s*\s*\s*' -- 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/IfileIt.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 41c0cd5cc..89f6cd35f 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.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 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hoster/IfileIt.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 89f6cd35f..b44ecb6dd 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -48,17 +48,17 @@ class IfileIt(SimpleHoster): if json_response['status'] == 3: self.offline() - if json_response["captcha"]: + if json_response['captcha']: captcha_key = re.search(self.RECAPTCHA_KEY_PATTERN, self.html).group(1) recaptcha = ReCaptcha(self) - post_data["ctype"] = "recaptcha" + post_data['ctype'] = "recaptcha" for _ in xrange(5): - post_data["recaptcha_challenge"], post_data["recaptcha_response"] = recaptcha.challenge(captcha_key) + post_data['recaptcha_challenge'], post_data['recaptcha_response'] = recaptcha.challenge(captcha_key) json_response = json_loads(self.load(json_url, post=post_data)) self.logDebug(json_response) - if json_response["retry"]: + if json_response['retry']: self.invalidCaptcha() else: self.correctCaptcha() @@ -69,7 +69,7 @@ class IfileIt(SimpleHoster): if not "ticket_url" in json_response: self.parseError("Download URL") - self.download(json_response["ticket_url"]) + self.download(json_response['ticket_url']) getInfo = create_getInfo(IfileIt) -- cgit v1.2.3 From 544900fde4e3f4441371ed7328aef07f51b5a358 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 16 Jul 2014 01:14:52 +0200 Subject: Remove some unused pattern attributes --- module/plugins/hoster/IfileIt.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index b44ecb6dd..b75daf3af 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -30,8 +30,6 @@ class IfileIt(SimpleHoster): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - #EVAL_PATTERN = r'(eval\(function\(p,a,c,k,e,d\).*)' - #DEC_PATTERN = r'requestBtn_clickEvent[^}]*url:\s*([^,]+)' LINK_PATTERN = r' If it doesn\'t, ' RECAPTCHA_KEY_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" FILE_INFO_PATTERN = r'. -""" - import re -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + from module.common.json_layer import json_loads from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class IfileIt(SimpleHoster): __name__ = "IfileIt" __type__ = "hoster" - __pattern__ = r'^unmatchable$' __version__ = "0.27" + + __pattern__ = r'^unmatchable$' + __description__ = """Ifile.it""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -36,6 +24,7 @@ class IfileIt(SimpleHoster): OFFLINE_PATTERN = r'Downloading of this file is temporarily disabled' + def handleFree(self): ukey = re.match(self.__pattern__, self.pyfile.url).group(1) json_url = 'http://ifile.it/new_download-request.json' -- cgit v1.2.3 From 23ae563604dca1dae262fbc598154b99b2f1eae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 3 Oct 2014 09:06:05 +0200 Subject: Update plugins after CaptchaService and XFileSharingPro changes --- module/plugins/hoster/IfileIt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 5dfd14d82..0cdb00b30 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -19,7 +19,7 @@ class IfileIt(SimpleHoster): __author_mail__ = "zoidberg@mujmail.cz" LINK_PATTERN = r' If it doesn\'t, ' - RECAPTCHA_KEY_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" + RECAPTCHA_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" FILE_INFO_PATTERN = r']*>\s* \s*\s*\s*' TEMP_OFFLINE_PATTERN = r'Downloading of this file is temporarily disabled' @@ -36,7 +36,8 @@ class IfileIt(SimpleHoster): self.offline() if json_response['captcha']: - captcha_key = re.search(self.RECAPTCHA_KEY_PATTERN, self.html).group(1) + captcha_key = re.search(self.RECAPTCHA_PATTERN, self.html).group(1) + recaptcha = ReCaptcha(self) post_data['ctype'] = "recaptcha" -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hoster/IfileIt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 0cdb00b30..9be7c5933 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -15,8 +15,8 @@ class IfileIt(SimpleHoster): __pattern__ = r'^unmatchable$' __description__ = """Ifile.it""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + LINK_PATTERN = r' If it doesn\'t, ' RECAPTCHA_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/IfileIt.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 9be7c5933..2c228ee8e 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -15,6 +15,7 @@ class IfileIt(SimpleHoster): __pattern__ = r'^unmatchable$' __description__ = """Ifile.it""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] -- cgit v1.2.3 From f76e5c2336718dca9da8033ba22cd83c72c7b3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:14:28 +0200 Subject: Pattern update 1 --- module/plugins/hoster/IfileIt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 2c228ee8e..39bfcb233 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -21,7 +21,7 @@ class IfileIt(SimpleHoster): LINK_PATTERN = r' If it doesn\'t, ' RECAPTCHA_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" - FILE_INFO_PATTERN = r']*>\s*(?P.*?)\s* \s*\s*(?P[\d.]+)\s*(?P\w+)\s*\s*' OFFLINE_PATTERN = r'Downloading of this file is temporarily disabled' -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 2 --- module/plugins/hoster/IfileIt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 39bfcb233..e368f5f78 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -21,7 +21,7 @@ class IfileIt(SimpleHoster): LINK_PATTERN = r' If it doesn\'t, ' RECAPTCHA_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" - FILE_INFO_PATTERN = r']*>\s*(?P.*?)\s* \s*\s*(?P[\d.,]+)\s*(?P\w+)\s*\s*' OFFLINE_PATTERN = r'Downloading of this file is temporarily disabled' -- cgit v1.2.3 From 8939f015a688a07ec7d0bd14b6a3704f6a2cb4a0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:12:40 +0200 Subject: Pattern update 3 --- module/plugins/hoster/IfileIt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index e368f5f78..6fb8e992f 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -20,7 +20,7 @@ class IfileIt(SimpleHoster): LINK_PATTERN = r' If it doesn\'t, ' - RECAPTCHA_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';" + RECAPTCHA_PATTERN = r'var __recaptcha_public\s*=\s*\'(.+?)\'' FILE_INFO_PATTERN = r']*>\s* \s*\s*\s*' TEMP_OFFLINE_PATTERN = r'Downloading of this file is temporarily disabled' -- cgit v1.2.3 From 388a2f6478d42e423f1f8442d8539983f3762f22 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 14 Oct 2014 13:38:49 +0200 Subject: Improve unit detection in size pattern --- module/plugins/hoster/IfileIt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 6fb8e992f..e6bd4fd04 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -21,7 +21,7 @@ class IfileIt(SimpleHoster): LINK_PATTERN = r' If it doesn\'t, ' RECAPTCHA_PATTERN = r'var __recaptcha_public\s*=\s*\'(.+?)\'' - FILE_INFO_PATTERN = r']*>\s*(?P.*?)\s* \s*\s*(?P[\d.,]+)\s*(?P[\w^_]+)\s*\s*' OFFLINE_PATTERN = r'Downloading of this file is temporarily disabled' -- cgit v1.2.3 From 2ae91b81a2f12a1c9b1f78524df78a2b3f1ef494 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Oct 2014 14:52:42 +0200 Subject: Update hosters to self.error --- module/plugins/hoster/IfileIt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index e6bd4fd04..ca5896e2d 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class IfileIt(SimpleHoster): __name__ = "IfileIt" __type__ = "hoster" - __version__ = "0.27" + __version__ = "0.28" __pattern__ = r'^unmatchable$' @@ -56,7 +56,7 @@ class IfileIt(SimpleHoster): self.fail("Incorrect captcha") if not "ticket_url" in json_response: - self.parseError("Download URL") + self.error("Download URL") self.download(json_response['ticket_url']) -- cgit v1.2.3 From 1c4bf83881d2a22da3773666a580d51f6b57bfd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 03:07:21 +0200 Subject: Avoid gettext conflict due variable `_` --- module/plugins/hoster/IfileIt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index ca5896e2d..6f92b4b42 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -42,7 +42,7 @@ class IfileIt(SimpleHoster): recaptcha = ReCaptcha(self) post_data['ctype'] = "recaptcha" - for _ in xrange(5): + for _i in xrange(5): post_data['recaptcha_challenge'], post_data['recaptcha_response'] = recaptcha.challenge(captcha_key) json_response = json_loads(self.load(json_url, post=post_data)) self.logDebug(json_response) -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hoster/IfileIt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 6f92b4b42..f06fa2788 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -53,10 +53,10 @@ class IfileIt(SimpleHoster): self.correctCaptcha() break else: - self.fail("Incorrect captcha") + self.fail(_("Incorrect captcha")) if not "ticket_url" in json_response: - self.error("Download URL") + self.error(_("No download URL")) self.download(json_response['ticket_url']) -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/IfileIt.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index f06fa2788..899a7f297 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -8,15 +8,15 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class IfileIt(SimpleHoster): - __name__ = "IfileIt" - __type__ = "hoster" + __name__ = "IfileIt" + __type__ = "hoster" __version__ = "0.28" __pattern__ = r'^unmatchable$' __description__ = """Ifile.it""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] LINK_PATTERN = r' If it doesn\'t, ' -- cgit v1.2.3 From 772e47ef806d18fd209e910be0535bce7c07dc7b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Nov 2014 22:47:07 +0100 Subject: Update all other plugins --- module/plugins/hoster/IfileIt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index 899a7f297..b7e37457d 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -21,7 +21,7 @@ class IfileIt(SimpleHoster): LINK_PATTERN = r' If it doesn\'t, ' RECAPTCHA_PATTERN = r'var __recaptcha_public\s*=\s*\'(.+?)\'' - FILE_INFO_PATTERN = r']*>\s*(?P.*?)\s* \s*\s*(?P[\d.,]+)\s*(?P[\w^_]+)\s*\s*' OFFLINE_PATTERN = r'Downloading of this file is temporarily disabled' -- cgit v1.2.3 From 4d578cb15f3d6edd036e438e504739b97660f93e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Dec 2014 16:58:35 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/IfileIt.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'module/plugins/hoster/IfileIt.py') diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index b7e37457d..2dae4cd80 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -27,27 +27,30 @@ class IfileIt(SimpleHoster): def handleFree(self): - ukey = re.match(self.__pattern__, self.pyfile.url).group(1) - json_url = 'http://ifile.it/new_download-request.json' + ukey = re.match(self.__pattern__, self.pyfile.url).group(1) + json_url = 'http://ifile.it/new_download-request.json' post_data = {"ukey": ukey, "ab": "0"} + res = json_loads(self.load(json_url, post=post_data)) - json_response = json_loads(self.load(json_url, post=post_data)) - self.logDebug(json_response) - if json_response['status'] == 3: + self.logDebug(res) + + if res['status'] == 3: self.offline() - if json_response['captcha']: + if res['captcha']: captcha_key = re.search(self.RECAPTCHA_PATTERN, self.html).group(1) recaptcha = ReCaptcha(self) post_data['ctype'] = "recaptcha" for _i in xrange(5): - post_data['recaptcha_challenge'], post_data['recaptcha_response'] = recaptcha.challenge(captcha_key) - json_response = json_loads(self.load(json_url, post=post_data)) - self.logDebug(json_response) + challenge, response = recaptcha.challenge(captcha_key) + post_data.update({'recaptcha_challenge': challenge, + 'recaptcha_response' : response}) + res = json_loads(self.load(json_url, post=post_data)) + self.logDebug(res) - if json_response['retry']: + if res['retry']: self.invalidCaptcha() else: self.correctCaptcha() @@ -55,10 +58,10 @@ class IfileIt(SimpleHoster): else: self.fail(_("Incorrect captcha")) - if not "ticket_url" in json_response: + if not "ticket_url" in res: self.error(_("No download URL")) - self.download(json_response['ticket_url']) + self.download(res['ticket_url']) getInfo = create_getInfo(IfileIt) -- cgit v1.2.3