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/ExtabitCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 4dba81a8f..4396f08cb 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -35,7 +35,7 @@ class ExtabitCom(SimpleHoster): FILE_NAME_PATTERN = r'File:\s*\s*
' FILE_SIZE_PATTERN = r'Size:\s*(?P[^<]+)' - FILE_OFFLINE_PATTERN = r'>File not found<' + OFFLINE_PATTERN = r'>File not found<' TEMP_OFFLINE_PATTERN = r">(File is temporary unavailable|No download mirror)<" DOWNLOAD_LINK_PATTERN = r'[\'"](http://guest\d+\.extabit\.com/[a-z0-9]+/.*?)[\'"]' -- cgit v1.2.3 From 0072668fd976f9ce4dbaac7e807791f21cbe07ed Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 6 Jul 2014 18:57:55 +0200 Subject: Compute wait time using secondsToMidnight --- module/plugins/hoster/ExtabitCom.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 4396f08cb..c2b5098e9 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -13,22 +13,22 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: zoidberg """ import re +from module.common.json_layer import json_loads + +from module.plugins.hoster.UnrestrictLi import secondsToMidnight from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.plugins.internal.CaptchaService import ReCaptcha -from module.common.json_layer import json_loads class ExtabitCom(SimpleHoster): __name__ = "ExtabitCom" __type__ = "hoster" __pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P\w+)' - __version__ = "0.5" + __version__ = "0.6" __description__ = """Extabit.com hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -48,7 +48,8 @@ class ExtabitCom(SimpleHoster): if m: self.wait(int(m.group(1)) * 60, True) elif "The daily downloads limit from your IP is exceeded" in self.html: - self.wait(1 * 60 * 60, True) + self.logWarning("You have reached your daily downloads limit for today") + self.wait(secondsToMidnight(gmt=2), True) self.logDebug("URL: " + self.req.http.lastEffectiveURL) m = re.match(self.__pattern__, self.req.http.lastEffectiveURL) -- 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/ExtabitCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index c2b5098e9..874eeb824 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -36,9 +36,9 @@ class ExtabitCom(SimpleHoster): FILE_NAME_PATTERN = r'File:\s*\s*
' FILE_SIZE_PATTERN = r'Size:\s*(?P[^<]+)' OFFLINE_PATTERN = r'>File not found<' - TEMP_OFFLINE_PATTERN = r">(File is temporary unavailable|No download mirror)<" + TEMP_OFFLINE_PATTERN = r'>(File is temporary unavailable|No download mirror)<' - DOWNLOAD_LINK_PATTERN = r'[\'"](http://guest\d+\.extabit\.com/[a-z0-9]+/.*?)[\'"]' + LINK_PATTERN = r'[\'"](http://guest\d+\.extabit\.com/[a-z0-9]+/.*?)[\'"]' def handleFree(self): if r">Only premium users can download this file" in self.html: @@ -78,7 +78,7 @@ class ExtabitCom(SimpleHoster): self.parseError('JSON') self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href'])) - m = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) + m = re.search(self.LINK_PATTERN, self.html) if not m: self.parseError('Download URL') url = m.group(1) -- 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/ExtabitCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 874eeb824..b5fb9608e 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -62,7 +62,7 @@ class ExtabitCom(SimpleHoster): for _ in xrange(5): get_data = {"type": "recaptcha"} - get_data["challenge"], get_data["capture"] = recaptcha.challenge(captcha_key) + get_data['challenge'], get_data['capture'] = recaptcha.challenge(captcha_key) response = json_loads(self.load("http://extabit.com/file/%s/" % fileID, get=get_data)) if "ok" in response: self.correctCaptcha() -- 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/hoster/ExtabitCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index b5fb9608e..fac7922db 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -79,7 +79,7 @@ class ExtabitCom(SimpleHoster): self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href'])) m = re.search(self.LINK_PATTERN, self.html) - if not m: + if m is None: self.parseError('Download URL') url = m.group(1) self.logDebug("Download URL: " + url) -- 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/ExtabitCom.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index fac7922db..2409d8517 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -1,34 +1,21 @@ # -*- 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 module.common.json_layer import json_loads from module.plugins.hoster.UnrestrictLi import secondsToMidnight -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ExtabitCom(SimpleHoster): __name__ = "ExtabitCom" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P\w+)' __version__ = "0.6" + + __pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P\w+)' + __description__ = """Extabit.com hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -40,6 +27,7 @@ class ExtabitCom(SimpleHoster): LINK_PATTERN = r'[\'"](http://guest\d+\.extabit\.com/[a-z0-9]+/.*?)[\'"]' + def handleFree(self): if r">Only premium users can download this file" in self.html: self.fail("Only premium users can download this file") -- 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/ExtabitCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 2409d8517..64538f65f 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -17,8 +17,8 @@ class ExtabitCom(SimpleHoster): __pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P\w+)' __description__ = """Extabit.com hoster plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + FILE_NAME_PATTERN = r'File:\s*\s*
' FILE_SIZE_PATTERN = r'Size:\s*(?P[^<]+)' -- 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/ExtabitCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 64538f65f..808ff712c 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -17,6 +17,7 @@ class ExtabitCom(SimpleHoster): __pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P\w+)' __description__ = """Extabit.com hoster plugin""" + __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/ExtabitCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 808ff712c..4b0d3d95b 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -26,7 +26,7 @@ class ExtabitCom(SimpleHoster): OFFLINE_PATTERN = r'>File not found<' TEMP_OFFLINE_PATTERN = r'>(File is temporary unavailable|No download mirror)<' - LINK_PATTERN = r'[\'"](http://guest\d+\.extabit\.com/[a-z0-9]+/.*?)[\'"]' + LINK_PATTERN = r'[\'"](http://guest\d+\.extabit\.com/\w+/.*?)[\'"]' def handleFree(self): -- 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/ExtabitCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 4b0d3d95b..489b2453e 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ExtabitCom(SimpleHoster): __name__ = "ExtabitCom" __type__ = "hoster" - __version__ = "0.6" + __version__ = "0.61" __pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P\w+)' @@ -61,15 +61,15 @@ class ExtabitCom(SimpleHoster): else: self.fail("Invalid captcha") else: - self.parseError('Captcha') + self.error('Captcha') if not "href" in response: - self.parseError('JSON') + self.error('JSON') self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href'])) m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.parseError('Download URL') + self.error('Download URL') url = m.group(1) self.logDebug("Download URL: " + url) self.download(url) -- cgit v1.2.3 From 4da90891eb2544ac15a7d512aba8cb357f68ee5f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 01:11:29 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/ExtabitCom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 489b2453e..15f8b5d1c 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -67,11 +67,12 @@ class ExtabitCom(SimpleHoster): self.error('JSON') self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href'])) + m = re.search(self.LINK_PATTERN, self.html) if m is None: self.error('Download URL') + url = m.group(1) - self.logDebug("Download URL: " + url) self.download(url) -- cgit v1.2.3 From e3f5280529921100f48bb8a79853bf480c7611e4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 02:53:05 +0200 Subject: Replace single quotes with doubles in self.error and self.fail msg --- module/plugins/hoster/ExtabitCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 15f8b5d1c..36588c4a8 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -61,16 +61,16 @@ class ExtabitCom(SimpleHoster): else: self.fail("Invalid captcha") else: - self.error('Captcha') + self.error("Captcha") if not "href" in response: - self.error('JSON') + self.error("JSON") self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href'])) m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error('Download URL') + self.error("Download URL") url = m.group(1) self.download(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/ExtabitCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 36588c4a8..493644721 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -49,7 +49,7 @@ class ExtabitCom(SimpleHoster): recaptcha = ReCaptcha(self) captcha_key = m.group(1) - for _ in xrange(5): + for _i in xrange(5): get_data = {"type": "recaptcha"} get_data['challenge'], get_data['capture'] = recaptcha.challenge(captcha_key) response = json_loads(self.load("http://extabit.com/file/%s/" % fileID, get=get_data)) -- 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/ExtabitCom.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 493644721..b2a2fea65 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -31,13 +31,13 @@ class ExtabitCom(SimpleHoster): def handleFree(self): if r">Only premium users can download this file" in self.html: - self.fail("Only premium users can download this file") + self.fail(_("Only premium users can download this file")) m = re.search(r"Next free download from your ip will be available in (\d+)\s*minutes", self.html) if m: self.wait(int(m.group(1)) * 60, True) elif "The daily downloads limit from your IP is exceeded" in self.html: - self.logWarning("You have reached your daily downloads limit for today") + self.logWarning(_("You have reached your daily downloads limit for today")) self.wait(secondsToMidnight(gmt=2), True) self.logDebug("URL: " + self.req.http.lastEffectiveURL) @@ -59,18 +59,18 @@ class ExtabitCom(SimpleHoster): else: self.invalidCaptcha() else: - self.fail("Invalid captcha") + self.fail(_("Invalid captcha")) else: - self.error("Captcha") + self.error(_("Captcha")) if not "href" in response: - self.error("JSON") + self.error(_("Bad JSON response")) self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href'])) m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Download URL") + self.error(_("LINK_PATTERN not found")) url = m.group(1) self.download(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/ExtabitCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index b2a2fea65..0e4cadb04 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -10,15 +10,15 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ExtabitCom(SimpleHoster): - __name__ = "ExtabitCom" - __type__ = "hoster" + __name__ = "ExtabitCom" + __type__ = "hoster" __version__ = "0.61" __pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P\w+)' __description__ = """Extabit.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] FILE_NAME_PATTERN = r'File:\s*\s*
' -- 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/ExtabitCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 0e4cadb04..2f6d4b378 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -21,8 +21,8 @@ class ExtabitCom(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_NAME_PATTERN = r'File:\s*\s*
' - FILE_SIZE_PATTERN = r'Size:\s*(?P[^<]+)' + NAME_PATTERN = r'File:\s*\s*
' + SIZE_PATTERN = r'Size:\s*(?P[^<]+)' OFFLINE_PATTERN = r'>File not found<' TEMP_OFFLINE_PATTERN = r'>(File is temporary unavailable|No download mirror)<' -- cgit v1.2.3 From 03f3b86f500c495932fd118b54569d92f700847c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 3 Nov 2014 16:57:55 +0100 Subject: Code cosmetics about file_info and other stuff --- module/plugins/hoster/ExtabitCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 2f6d4b378..1cfddd64d 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ExtabitCom(SimpleHoster): __name__ = "ExtabitCom" __type__ = "hoster" - __version__ = "0.61" + __version__ = "0.62" __pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P\w+)' @@ -42,7 +42,7 @@ class ExtabitCom(SimpleHoster): self.logDebug("URL: " + self.req.http.lastEffectiveURL) m = re.match(self.__pattern__, self.req.http.lastEffectiveURL) - fileID = m.group('ID') if m else self.file_info('ID') + fileID = m.group('ID') if m else self.info('ID') m = re.search(r'recaptcha/api/challenge\?k=(\w+)', self.html) if m: -- cgit v1.2.3 From c9e31d875d32de31e54959b82bc35eff2b3e0f3f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 10 Nov 2014 00:19:51 +0100 Subject: Code cosmetics --- module/plugins/hoster/ExtabitCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 1cfddd64d..fc38a79a9 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -52,8 +52,8 @@ class ExtabitCom(SimpleHoster): for _i in xrange(5): get_data = {"type": "recaptcha"} get_data['challenge'], get_data['capture'] = recaptcha.challenge(captcha_key) - response = json_loads(self.load("http://extabit.com/file/%s/" % fileID, get=get_data)) - if "ok" in response: + res = json_loads(self.load("http://extabit.com/file/%s/" % fileID, get=get_data)) + if "ok" in res: self.correctCaptcha() break else: @@ -63,10 +63,10 @@ class ExtabitCom(SimpleHoster): else: self.error(_("Captcha")) - if not "href" in response: + if not "href" in res: self.error(_("Bad JSON response")) - self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href'])) + self.html = self.load("http://extabit.com/file/%s%s" % (fileID, res['href'])) m = re.search(self.LINK_PATTERN, self.html) if m is None: -- cgit v1.2.3 From b6a2bd53628bd2824bac1dafc7b4eafdf3c815dd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:48:03 +0100 Subject: Update plugins after SimpleHoster changes --- module/plugins/hoster/ExtabitCom.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/ExtabitCom.py') diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index fc38a79a9..7609954d3 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -4,15 +4,14 @@ import re from module.common.json_layer import json_loads -from module.plugins.hoster.UnrestrictLi import secondsToMidnight from module.plugins.internal.CaptchaService import ReCaptcha -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, secondsToMidnight class ExtabitCom(SimpleHoster): __name__ = "ExtabitCom" __type__ = "hoster" - __version__ = "0.62" + __version__ = "0.63" __pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P\w+)' -- cgit v1.2.3