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