diff options
Diffstat (limited to 'module/plugins/hoster/TurbobitNet.py')
-rw-r--r-- | module/plugins/hoster/TurbobitNet.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 95fcae7f2..9de7f9bd0 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -26,8 +26,8 @@ from pycurl import HTTPHEADER class TurbobitNet(SimpleHoster): __name__ = "TurbobitNet" __type__ = "hoster" - __pattern__ = r"http://(?:\w*\.)?turbobit.net/(?:download/free/)?(?P<ID>\w+).*" - __version__ = "0.03" + __pattern__ = r"http://(?:\w*\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P<ID>\w+).*" + __version__ = "0.05" __description__ = """Turbobit.net plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -35,12 +35,12 @@ class TurbobitNet(SimpleHoster): FILE_INFO_PATTERN = r"<span class='file-icon1[^>]*>(?P<N>[^<]+)</span>\s*\((?P<S>[^\)]+)\)\s*</h1>" #long filenames are shortened FILE_NAME_PATTERN = r'<meta name="keywords" content="\s*(?P<N>[^,]+)' #full name but missing on page2 FILE_OFFLINE_PATTERN = r'<h2>File Not Found</h2>' - FILE_URL_REPLACEMENTS = [(r'(?<=http://)(.*?)(?=turbobit.net/)', '')] + FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "turbobit.net")] SH_COOKIES = [("turbobit.net", "user_lang", "en")] CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' DOWNLOAD_URL_PATTERN = r'(?P<url>/download/redirect/[^"\']+)' - LIMIT_WAIT_PATTERN = r'<div id="time-limit-text">\s*.*?<span id=\'timeout\'>(\d+)</span> seconds' + LIMIT_WAIT_PATTERN = r'<div id="time-limit-text">\s*.*?<span id=\'timeout\'>(\d+)</span>' CAPTCHA_SRC_PATTERN = r'<img alt="Captcha" src="(.*?)"' def handleFree(self): @@ -53,7 +53,8 @@ class TurbobitNet(SimpleHoster): for i in range(5): found = re.search(self.LIMIT_WAIT_PATTERN, self.html) if found: - self.setWait(int(found.group(1)), True) + wait_time = int(found.group(1)) + self.setWait(wait_time, wait_time > 60) self.wait() self.retry() |