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/TurbobitNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index f15b8b0c4..af9cdc59f 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -45,7 +45,7 @@ class TurbobitNet(SimpleHoster): # long filenames are shortened FILE_INFO_PATTERN = r"\w+).*", "http://turbobit.net/\g.html")] SH_COOKIES = [("turbobit.net", "user_lang", "en")] -- 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/TurbobitNet.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index af9cdc59f..34b449f7c 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -42,19 +42,20 @@ class TurbobitNet(SimpleHoster): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - # long filenames are shortened - FILE_INFO_PATTERN = r"\w+).*", "http://turbobit.net/\g.html")] SH_COOKIES = [("turbobit.net", "user_lang", "en")] - CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' - DOWNLOAD_URL_PATTERN = r'(?P/download/redirect/[^"\']+)' + LINK_PATTERN = r'(?P/download/redirect/[^"\']+)' LIMIT_WAIT_PATTERN = r'
\s*.*?(\d+)' + CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' CAPTCHA_SRC_PATTERN = r'Captcha Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hoster/TurbobitNet.py | 5 ----- 1 file changed, 5 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 34b449f7c..4649c3143 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -1,9 +1,6 @@ # -*- coding: utf-8 -*- """ - Copyright (C) 2012 pyLoad team - Copyright (C) 2012 JD-Team support@jdownloader.org - 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, @@ -16,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 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/TurbobitNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 4649c3143..cb0166ef8 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -87,7 +87,7 @@ class TurbobitNet(SimpleHoster): captcha_key) else: found = re.search(self.CAPTCHA_SRC_PATTERN, self.html) - if not found: + if found is None: self.parseError('captcha') captcha_url = found.group(1) inputs['captcha_response'] = self.decryptCaptcha(captcha_url) @@ -169,7 +169,7 @@ class TurbobitNet(SimpleHoster): def downloadFile(self): found = re.search(self.LINK_PATTERN, self.html) - if not found: + if found is None: self.parseError("download link") self.url = "http://turbobit.net" + found.group('url') self.logDebug(self.url) -- cgit v1.2.3 From a9f81c043c62abcb3ce38971237693736833fdbe Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:28:23 +0200 Subject: Fix hosters SH_COOKIES syntax --- module/plugins/hoster/TurbobitNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index cb0166ef8..9819257c7 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -43,7 +43,7 @@ class TurbobitNet(SimpleHoster): FILE_URL_REPLACEMENTS = [(r"http://(?:www\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P\w+).*", "http://turbobit.net/\g.html")] - SH_COOKIES = [("turbobit.net", "user_lang", "en")] + SH_COOKIES = [(".turbobit.net", "user_lang", "en")] LINK_PATTERN = r'(?P/download/redirect/[^"\']+)' LIMIT_WAIT_PATTERN = r'
\s*.*?(\d+)' -- 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/TurbobitNet.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 9819257c7..52708d045 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -68,9 +68,9 @@ class TurbobitNet(SimpleHoster): def solveCaptcha(self): for _ in xrange(5): - found = re.search(self.LIMIT_WAIT_PATTERN, self.html) - if found: - wait_time = int(found.group(1)) + m = re.search(self.LIMIT_WAIT_PATTERN, self.html) + if m: + wait_time = int(m.group(1)) self.wait(wait_time, wait_time > 60) self.retry() @@ -81,15 +81,15 @@ class TurbobitNet(SimpleHoster): if inputs['captcha_type'] == 'recaptcha': recaptcha = ReCaptcha(self) - found = re.search(self.CAPTCHA_KEY_PATTERN, self.html) - captcha_key = found.group(1) if found else '6LcTGLoSAAAAAHCWY9TTIrQfjUlxu6kZlTYP50_c' + m = re.search(self.CAPTCHA_KEY_PATTERN, self.html) + captcha_key = m.group(1) if m else '6LcTGLoSAAAAAHCWY9TTIrQfjUlxu6kZlTYP50_c' inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge( captcha_key) else: - found = re.search(self.CAPTCHA_SRC_PATTERN, self.html) - if found is None: + m = re.search(self.CAPTCHA_SRC_PATTERN, self.html) + if m is None: self.parseError('captcha') - captcha_url = found.group(1) + captcha_url = m.group(1) inputs['captcha_response'] = self.decryptCaptcha(captcha_url) self.logDebug(inputs) @@ -129,8 +129,8 @@ class TurbobitNet(SimpleHoster): def getDownloadUrl(self, rtUpdate): self.req.http.lastURL = self.url - found = re.search("(/\w+/timeout\.js\?\w+=)([^\"\'<>]+)", self.html) - url = "http://turbobit.net%s%s" % (found.groups() if found else ( + m = re.search("(/\w+/timeout\.js\?\w+=)([^\"\'<>]+)", self.html) + url = "http://turbobit.net%s%s" % (m.groups() if m else ( '/files/timeout.js?ver=', ''.join(random.choice('0123456789ABCDEF') for _ in xrange(32)))) fun = self.load(url) @@ -168,10 +168,10 @@ class TurbobitNet(SimpleHoster): self.downloadFile() def downloadFile(self): - found = re.search(self.LINK_PATTERN, self.html) - if found is None: + m = re.search(self.LINK_PATTERN, self.html) + if m is None: self.parseError("download link") - self.url = "http://turbobit.net" + found.group('url') + self.url = "http://turbobit.net" + m.group('url') self.logDebug(self.url) self.download(self.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/TurbobitNet.py | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 52708d045..a9cc46614 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -1,38 +1,26 @@ # -*- 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 import random -from urllib import quote -from binascii import hexlify, unhexlify +import re import time -from pycurl import HTTPHEADER from Crypto.Cipher import ARC4 +from binascii import hexlify, unhexlify +from pycurl import HTTPHEADER +from urllib import quote + from module.network.RequestFactory import getURL -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp class TurbobitNet(SimpleHoster): __name__ = "TurbobitNet" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?(turbobit.net|unextfiles.com)/(?!download/folder/)(?:download/free/)?(?P\w+).*' __version__ = "0.11" + + __pattern__ = r'http://(?:www\.)?(turbobit.net|unextfiles.com)/(?!download/folder/)(?:download/free/)?(?P\w+).*' + __description__ = """Turbobit.net plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -111,7 +99,7 @@ class TurbobitNet(SimpleHoster): # that's right, we are even using jdownloader updates rtUpdate = getURL("http://update0.jdownloader.org/pluginstuff/tbupdate.js") rtUpdate = self.decrypt(rtUpdate.splitlines()[1]) - # but we still need to fix the syntax to work with other engines than rhino + # but we still need to fix the syntax to work with other engines than rhino rtUpdate = re.sub(r'for each\(var (\w+) in(\[[^\]]+\])\)\{', r'zza=\2;for(var zzi=0;zzi\w+).*", "http://turbobit.net/\g.html")] - SH_COOKIES = [(".turbobit.net", "user_lang", "en")] + COOKIES = [(".turbobit.net", "user_lang", "en")] LINK_PATTERN = r'(?P/download/redirect/[^"\']+)' LIMIT_WAIT_PATTERN = r'
\s*.*?(\d+)' -- cgit v1.2.3 From 1f2d3d9541727e8fe9b21f48e51ef495ca2d8676 Mon Sep 17 00:00:00 2001 From: prOq Date: Fri, 26 Sep 2014 22:19:52 +0200 Subject: [TurbobitNet] Fixed some patterns --- module/plugins/hoster/TurbobitNet.py | 51 ++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 20 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 6b60d5bc8..fbb163591 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -17,31 +17,32 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t class TurbobitNet(SimpleHoster): __name__ = "TurbobitNet" __type__ = "hoster" - __version__ = "0.11" + __version__ = "0.12" - __pattern__ = r'http://(?:www\.)?(turbobit.net|unextfiles.com)/(?!download/folder/)(?:download/free/)?(?P\w+).*' + __pattern__ = r'http://(?:www\.)?turbobit\.net/(?:download/free/)?(?P\w+)' - __description__ = """Turbobit.net plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __description__ = """ Turbobit.net hoster plugin """ + __author_name__ = ("zoidberg", "prOq") + __author_mail__ = ("zoidberg@mujmail.cz", "") - FILE_INFO_PATTERN = r"(?P.+?)<' + FILE_SIZE_PATTERN = r'class="file-size">(?P[\d,.]+) (?P\w+)' OFFLINE_PATTERN = r'

File Not Found

|html\(\'File (?:was )?not found' - FILE_URL_REPLACEMENTS = [(r"http://(?:www\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P\w+).*", - "http://turbobit.net/\g.html")] + FILE_URL_REPLACEMENTS = [(__pattern__, "http://turbobit.net/\g.html")] + COOKIES = [(".turbobit.net", "user_lang", "en")] LINK_PATTERN = r'(?P/download/redirect/[^"\']+)' - LIMIT_WAIT_PATTERN = r'
\s*.*?(\d+)' + LIMIT_WAIT_PATTERN = r"
(\d+)<" CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' - CAPTCHA_SRC_PATTERN = r'Captcha" in self.html: + if '
Incorrect, try again!<' in self.html: + self.logInfo("Invalid captcha") self.invalidCaptcha() else: self.correctCaptcha() @@ -91,11 +94,12 @@ class TurbobitNet(SimpleHoster): else: self.fail("Invalid captcha") + def getRtUpdate(self): rtUpdate = self.getStorage("rtUpdate") if not rtUpdate: - if self.getStorage("version") != self.__version__ or int( - self.getStorage("timestamp", 0)) + 86400000 < timestamp(): + if self.getStorage("version") != self.__version__ \ + or int(self.getStorage("timestamp", 0)) + 86400000 < timestamp(): # that's right, we are even using jdownloader updates rtUpdate = getURL("http://update0.jdownloader.org/pluginstuff/tbupdate.js") rtUpdate = self.decrypt(rtUpdate.splitlines()[1]) @@ -114,19 +118,23 @@ class TurbobitNet(SimpleHoster): return rtUpdate + def getDownloadUrl(self, rtUpdate): self.req.http.lastURL = self.url m = re.search("(/\w+/timeout\.js\?\w+=)([^\"\'<>]+)", self.html) - url = "http://turbobit.net%s%s" % (m.groups() if m else ( - '/files/timeout.js?ver=', ''.join(random.choice('0123456789ABCDEF') for _ in xrange(32)))) + if m: + url = "http://turbobit.net%s%s" % m.groups() + else: + url = "http://turbobit.net/files/timeout.js?ver=%s" % "".join(random.choice('0123456789ABCDEF') for _ in xrange(32)) + fun = self.load(url) self.setWait(65, False) for b in [1, 3]: self.jscode = "var id = \'%s\';var b = %d;var inn = \'%s\';%sout" % ( - self.file_info['ID'], b, quote(fun), rtUpdate) + self.file_info['ID'], b, quote(fun), rtUpdate) try: out = self.js.eval(self.jscode) @@ -141,26 +149,29 @@ class TurbobitNet(SimpleHoster): self.delStorage("rtUpdate") self.retry() + def decrypt(self, data): cipher = ARC4.new(hexlify('E\x15\xa1\x9e\xa3M\xa0\xc6\xa0\x84\xb6H\x83\xa8o\xa0')) return unhexlify(cipher.encrypt(unhexlify(data))) + def getLocalTimeString(self): lt = time.localtime() tz = time.altzone if lt.tm_isdst else time.timezone return "%s GMT%+03d%02d" % (time.strftime("%a %b %d %Y %H:%M:%S", lt), -tz // 3600, tz % 3600) + def handlePremium(self): self.logDebug("Premium download as user %s" % self.user) self.html = self.load(self.pyfile.url) # Useless in 0.5 self.downloadFile() + def downloadFile(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.parseError("download link") + self.parseError("Download link not found") self.url = "http://turbobit.net" + m.group('url') - self.logDebug(self.url) self.download(self.url) -- cgit v1.2.3 From 98b6f2781ecff3ad2a0eefbea0c98cb832e76fda Mon Sep 17 00:00:00 2001 From: prOq Date: Sat, 27 Sep 2014 03:56:24 +0200 Subject: [CatShareNet] Plugin rewritten --- module/plugins/hoster/TurbobitNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index fbb163591..13c730b05 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -23,7 +23,7 @@ class TurbobitNet(SimpleHoster): __description__ = """ Turbobit.net hoster plugin """ __author_name__ = ("zoidberg", "prOq") - __author_mail__ = ("zoidberg@mujmail.cz", "") + __author_mail__ = ("zoidberg@mujmail.cz", None) FILE_NAME_PATTERN = r'id="file-title">(?P.+?)<' -- 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/TurbobitNet.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 13c730b05..999430bc2 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -36,8 +36,8 @@ class TurbobitNet(SimpleHoster): LINK_PATTERN = r'(?P/download/redirect/[^"\']+)' LIMIT_WAIT_PATTERN = r"
(\d+)<" - CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' - CAPTCHA_SRC_PATTERN = r'Captcha 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/TurbobitNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 999430bc2..99d8143b8 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -22,8 +22,8 @@ class TurbobitNet(SimpleHoster): __pattern__ = r'http://(?:www\.)?turbobit\.net/(?:download/free/)?(?P\w+)' __description__ = """ Turbobit.net hoster plugin """ - __author_name__ = ("zoidberg", "prOq") - __author_mail__ = ("zoidberg@mujmail.cz", None) + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("prOq", None)] FILE_NAME_PATTERN = r'id="file-title">(?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/TurbobitNet.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 99d8143b8..b56697da8 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -22,6 +22,7 @@ class TurbobitNet(SimpleHoster): __pattern__ = r'http://(?:www\.)?turbobit\.net/(?:download/free/)?(?P\w+)' __description__ = """ Turbobit.net hoster plugin """ + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), ("prOq", None)] -- 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/TurbobitNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index b56697da8..1eb3c98e9 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -28,7 +28,7 @@ class TurbobitNet(SimpleHoster): FILE_NAME_PATTERN = r'id="file-title">(?P.+?)<' - FILE_SIZE_PATTERN = r'class="file-size">(?P[\d,.]+) (?P\w+)' + FILE_SIZE_PATTERN = r'class="file-size">(?P[\d.,]+) (?P\w+)' OFFLINE_PATTERN = r'

File Not Found

|html\(\'File (?:was )?not found' FILE_URL_REPLACEMENTS = [(__pattern__, "http://turbobit.net/\g.html")] -- 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/TurbobitNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 1eb3c98e9..c48bbd8b8 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -36,7 +36,7 @@ class TurbobitNet(SimpleHoster): COOKIES = [(".turbobit.net", "user_lang", "en")] LINK_PATTERN = r'(?P/download/redirect/[^"\']+)' - LIMIT_WAIT_PATTERN = r"
(\d+)<" + LIMIT_WAIT_PATTERN = r'
(\d+)<' CAPTCHA_URL_PATTERN = r'Captcha Date: Tue, 14 Oct 2014 13:38:49 +0200 Subject: Improve unit detection in size pattern --- module/plugins/hoster/TurbobitNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index c48bbd8b8..2d3c4e14a 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -28,7 +28,7 @@ class TurbobitNet(SimpleHoster): FILE_NAME_PATTERN = r'id="file-title">(?P.+?)<' - FILE_SIZE_PATTERN = r'class="file-size">(?P[\d.,]+) (?P\w+)' + FILE_SIZE_PATTERN = r'class="file-size">(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'

File Not Found

|html\(\'File (?:was )?not found' FILE_URL_REPLACEMENTS = [(__pattern__, "http://turbobit.net/\g.html")] -- 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/TurbobitNet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 2d3c4e14a..8557e0ce7 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -17,7 +17,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t class TurbobitNet(SimpleHoster): __name__ = "TurbobitNet" __type__ = "hoster" - __version__ = "0.12" + __version__ = "0.13" __pattern__ = r'http://(?:www\.)?turbobit\.net/(?:download/free/)?(?P\w+)' @@ -67,20 +67,20 @@ class TurbobitNet(SimpleHoster): action, inputs = self.parseHtmlForm("action='#'") if not inputs: - self.parseError("captcha form") + self.error("captcha form") self.logDebug(inputs) if inputs['captcha_type'] == 'recaptcha': recaptcha = ReCaptcha(self) captcha_key = recaptcha.detect_key() if captcha_key is None: - self.parseError("ReCaptcha captcha key not found") + self.error("ReCaptcha captcha key not found") inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) else: m = re.search(self.CAPTCHA_URL_PATTERN, self.html) if m is None: - self.parseError('captcha') + self.error('captcha') captcha_url = m.group(1) inputs['captcha_response'] = self.decryptCaptcha(captcha_url) @@ -172,7 +172,7 @@ class TurbobitNet(SimpleHoster): def downloadFile(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.parseError("Download link not found") + self.error("Download link not found") self.url = "http://turbobit.net" + m.group('url') self.download(self.url) -- cgit v1.2.3 From 1b096b2eb2634e8dea80b06ab9ecde206b198b35 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:47:00 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/TurbobitNet.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 8557e0ce7..ded926010 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -38,7 +38,7 @@ class TurbobitNet(SimpleHoster): LINK_PATTERN = r'(?P/download/redirect/[^"\']+)' LIMIT_WAIT_PATTERN = r'
(\d+)<' - CAPTCHA_URL_PATTERN = r'Captcha Date: Thu, 23 Oct 2014 00:50:23 +0200 Subject: Simplify captcha challenge calls --- module/plugins/hoster/TurbobitNet.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index ded926010..d0b441fa2 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -72,11 +72,7 @@ class TurbobitNet(SimpleHoster): if inputs['captcha_type'] == 'recaptcha': recaptcha = ReCaptcha(self) - captcha_key = recaptcha.detect_key() - if captcha_key is None: - self.error("ReCaptcha captcha key not found") - - inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) + inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge() else: m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: -- 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/TurbobitNet.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index d0b441fa2..c1029ff70 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -67,7 +67,7 @@ class TurbobitNet(SimpleHoster): action, inputs = self.parseHtmlForm("action='#'") if not inputs: - self.error("captcha form") + self.error("Captcha form not found") self.logDebug(inputs) if inputs['captcha_type'] == 'recaptcha': @@ -84,7 +84,6 @@ class TurbobitNet(SimpleHoster): self.html = self.load(self.url, post=inputs) if '
Incorrect, try again!<' in self.html: - self.logInfo("Invalid captcha") self.invalidCaptcha() else: self.correctCaptcha() @@ -106,7 +105,6 @@ class TurbobitNet(SimpleHoster): r'zza=\2;for(var zzi=0;zzi 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/TurbobitNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index c1029ff70..1a6366c4a 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -76,7 +76,7 @@ class TurbobitNet(SimpleHoster): else: m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: - self.error('captcha') + self.error("captcha") captcha_url = m.group(1) inputs['captcha_response'] = self.decryptCaptcha(captcha_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/TurbobitNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 1a6366c4a..a12fc3874 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -58,7 +58,7 @@ class TurbobitNet(SimpleHoster): def solveCaptcha(self): - for _ in xrange(5): + for _i in xrange(5): m = re.search(self.LIMIT_WAIT_PATTERN, self.html) if m: wait_time = int(m.group(1)) @@ -122,7 +122,7 @@ class TurbobitNet(SimpleHoster): if m: url = "http://turbobit.net%s%s" % m.groups() else: - url = "http://turbobit.net/files/timeout.js?ver=%s" % "".join(random.choice('0123456789ABCDEF') for _ in xrange(32)) + url = "http://turbobit.net/files/timeout.js?ver=%s" % "".join(random.choice('0123456789ABCDEF') for _i in xrange(32)) fun = self.load(url) -- 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/TurbobitNet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index a12fc3874..4e26f74b1 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -67,7 +67,7 @@ class TurbobitNet(SimpleHoster): action, inputs = self.parseHtmlForm("action='#'") if not inputs: - self.error("Captcha form not found") + self.error(_("Captcha form not found")) self.logDebug(inputs) if inputs['captcha_type'] == 'recaptcha': @@ -76,7 +76,7 @@ class TurbobitNet(SimpleHoster): else: m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: - self.error("captcha") + self.error(_("captcha")) captcha_url = m.group(1) inputs['captcha_response'] = self.decryptCaptcha(captcha_url) @@ -89,7 +89,7 @@ class TurbobitNet(SimpleHoster): self.correctCaptcha() break else: - self.fail("Invalid captcha") + self.fail(_("Invalid captcha")) def getRtUpdate(self): @@ -109,7 +109,7 @@ class TurbobitNet(SimpleHoster): self.setStorage("timestamp", timestamp()) self.setStorage("version", self.__version__) else: - self.logError("Unable to download, wait for update...") + self.logError(_("Unable to download, wait for update...")) self.tempOffline() return rtUpdate @@ -165,7 +165,7 @@ class TurbobitNet(SimpleHoster): def downloadFile(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Download link not found") + self.error(_("Download link not found")) self.url = "http://turbobit.net" + m.group('url') self.download(self.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/TurbobitNet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 4e26f74b1..be6b00b2e 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -15,16 +15,16 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t class TurbobitNet(SimpleHoster): - __name__ = "TurbobitNet" - __type__ = "hoster" + __name__ = "TurbobitNet" + __type__ = "hoster" __version__ = "0.13" __pattern__ = r'http://(?:www\.)?turbobit\.net/(?:download/free/)?(?P\w+)' __description__ = """ Turbobit.net hoster plugin """ - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("prOq", None)] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("prOq", None)] FILE_NAME_PATTERN = r'id="file-title">(?P.+?)<' -- 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/TurbobitNet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index be6b00b2e..93e037664 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -27,11 +27,11 @@ class TurbobitNet(SimpleHoster): ("prOq", None)] - FILE_NAME_PATTERN = r'id="file-title">(?P.+?)<' - FILE_SIZE_PATTERN = r'class="file-size">(?P[\d.,]+) (?P[\w^_]+)' + NAME_PATTERN = r'id="file-title">(?P.+?)<' + SIZE_PATTERN = r'class="file-size">(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'

File Not Found

|html\(\'File (?:was )?not found' - FILE_URL_REPLACEMENTS = [(__pattern__, "http://turbobit.net/\g.html")] + URL_REPLACEMENTS = [(__pattern__, "http://turbobit.net/\g.html")] COOKIES = [(".turbobit.net", "user_lang", "en")] -- 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/TurbobitNet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 93e037664..c9d1ede34 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -17,7 +17,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t class TurbobitNet(SimpleHoster): __name__ = "TurbobitNet" __type__ = "hoster" - __version__ = "0.13" + __version__ = "0.14" __pattern__ = r'http://(?:www\.)?turbobit\.net/(?:download/free/)?(?P\w+)' @@ -42,7 +42,7 @@ class TurbobitNet(SimpleHoster): def handleFree(self): - self.url = "http://turbobit.net/download/free/%s" % self.file_info['ID'] + self.url = "http://turbobit.net/download/free/%s" % self.info['ID'] self.html = self.load(self.url, ref=True, decode=True) rtUpdate = self.getRtUpdate() @@ -130,7 +130,7 @@ class TurbobitNet(SimpleHoster): for b in [1, 3]: self.jscode = "var id = \'%s\';var b = %d;var inn = \'%s\';%sout" % ( - self.file_info['ID'], b, quote(fun), rtUpdate) + self.info['ID'], b, quote(fun), rtUpdate) try: out = self.js.eval(self.jscode) -- cgit v1.2.3 From e30b7892ed77158dc2e518bf322dc0a0a4430d4e Mon Sep 17 00:00:00 2001 From: Thierry Merle Date: Fri, 14 Nov 2014 01:39:27 +0100 Subject: [RapidgatorNet] Set the language in COOKIES --- module/plugins/hoster/TurbobitNet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index c9d1ede34..6aa7bdd4a 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -27,14 +27,14 @@ class TurbobitNet(SimpleHoster): ("prOq", None)] - NAME_PATTERN = r'id="file-title">(?P.+?)<' - SIZE_PATTERN = r'class="file-size">(?P[\d.,]+) (?P[\w^_]+)' - OFFLINE_PATTERN = r'

File Not Found

|html\(\'File (?:was )?not found' - URL_REPLACEMENTS = [(__pattern__, "http://turbobit.net/\g.html")] COOKIES = [(".turbobit.net", "user_lang", "en")] + NAME_PATTERN = r'id="file-title">(?P.+?)<' + SIZE_PATTERN = r'class="file-size">(?P[\d.,]+) (?P[\w^_]+)' + OFFLINE_PATTERN = r'

File Not Found

|html\(\'File (?:was )?not found' + LINK_PATTERN = r'(?P/download/redirect/[^"\']+)' LIMIT_WAIT_PATTERN = r'
(\d+)<' -- cgit v1.2.3 From e8246525f3106c152d6d1436c6a3111e0334520f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 15 Nov 2014 18:04:47 +0100 Subject: Fix cookie domain --- module/plugins/hoster/TurbobitNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 6aa7bdd4a..19ae766cb 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -29,7 +29,7 @@ class TurbobitNet(SimpleHoster): URL_REPLACEMENTS = [(__pattern__, "http://turbobit.net/\g.html")] - COOKIES = [(".turbobit.net", "user_lang", "en")] + COOKIES = [("turbobit.net", "user_lang", "en")] NAME_PATTERN = r'id="file-title">(?P.+?)<' SIZE_PATTERN = r'class="file-size">(?P[\d.,]+) (?P[\w^_]+)' -- cgit v1.2.3 From 2ca8cc959a587992dc389d6baf71dd3e4f66df1c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 23 Nov 2014 04:41:17 +0100 Subject: Fix some URL_REPLACEMENTS --- module/plugins/hoster/TurbobitNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 19ae766cb..7426ea35c 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -17,7 +17,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t class TurbobitNet(SimpleHoster): __name__ = "TurbobitNet" __type__ = "hoster" - __version__ = "0.14" + __version__ = "0.15" __pattern__ = r'http://(?:www\.)?turbobit\.net/(?:download/free/)?(?P\w+)' @@ -27,7 +27,7 @@ class TurbobitNet(SimpleHoster): ("prOq", None)] - URL_REPLACEMENTS = [(__pattern__, "http://turbobit.net/\g.html")] + URL_REPLACEMENTS = [(__pattern__ + ".*", "http://turbobit.net/\g.html")] COOKIES = [("turbobit.net", "user_lang", "en")] -- cgit v1.2.3 From 86d3b6249073947132ed3a9eeb1b1e987d19569a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 1 Dec 2014 18:17:13 +0100 Subject: Update some plugins --- module/plugins/hoster/TurbobitNet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 7426ea35c..9d7dcc67b 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -17,7 +17,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, t class TurbobitNet(SimpleHoster): __name__ = "TurbobitNet" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" __pattern__ = r'http://(?:www\.)?turbobit\.net/(?:download/free/)?(?P\w+)' @@ -42,7 +42,7 @@ class TurbobitNet(SimpleHoster): def handleFree(self): - self.url = "http://turbobit.net/download/free/%s" % self.info['ID'] + self.url = "http://turbobit.net/download/free/%s" % self.info['pattern']['ID'] self.html = self.load(self.url, ref=True, decode=True) rtUpdate = self.getRtUpdate() @@ -130,7 +130,7 @@ class TurbobitNet(SimpleHoster): for b in [1, 3]: self.jscode = "var id = \'%s\';var b = %d;var inn = \'%s\';%sout" % ( - self.info['ID'], b, quote(fun), rtUpdate) + self.info['pattern']['ID'], b, quote(fun), rtUpdate) try: out = self.js.eval(self.jscode) -- cgit v1.2.3 From 854efeb463bd98cb8e22f1f78f5ce97e6c0ab49f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 22 Dec 2014 16:45:04 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/TurbobitNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/TurbobitNet.py') diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 9d7dcc67b..258ec7d3e 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -35,7 +35,7 @@ class TurbobitNet(SimpleHoster): SIZE_PATTERN = r'class="file-size">(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'

File Not Found

|html\(\'File (?:was )?not found' - LINK_PATTERN = r'(?P/download/redirect/[^"\']+)' + LINK_PATTERN = r'(/download/redirect/[^"\']+)' LIMIT_WAIT_PATTERN = r'
(\d+)<' CAPTCHA_PATTERN = r'