diff options
Diffstat (limited to 'module/plugins/hoster/FileserveCom.py')
-rw-r--r-- | module/plugins/hoster/FileserveCom.py | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 515ec9029..6ea1d6541 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -4,9 +4,9 @@ import re from module.common.json_layer import json_loads from module.network.RequestFactory import getURL -from module.plugins.Hoster import Hoster -from module.plugins.Plugin import chunks -from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.internal.Hoster import Hoster +from module.plugins.internal.Plugin import chunks +from module.plugins.internal.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import secondsToMidnight from module.utils import parseFileSize @@ -33,27 +33,29 @@ def checkFile(plugin, urls): class FileserveCom(Hoster): __name__ = "FileserveCom" __type__ = "hoster" - __version__ = "0.53" + __version__ = "0.56" __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P<ID>[^/]+)' __description__ = """Fileserve.com hoster plugin""" __license__ = "GPLv3" - __authors__ = [("jeix", "jeix@hasnomail.de"), - ("mkaay", "mkaay@mkaay.de"), - ("Paul King", None), - ("zoidberg", "zoidberg@mujmail.cz")] + __authors__ = [("jeix" , "jeix@hasnomail.de" ), + ("mkaay" , "mkaay@mkaay.de" ), + ("Paul King", None ), + ("zoidberg" , "zoidberg@mujmail.cz")] - URLS = ["http://www.fileserve.com/file/", "http://www.fileserve.com/link-checker.php", + URLS = ["http://www.fileserve.com/file/", + "http://www.fileserve.com/link-checker.php", "http://www.fileserve.com/checkReCaptcha.php"] + LINKCHECK_TR = r'<tr>\s*(<td>http://www\.fileserve\.com/file/.*?)</tr>' - LINKCHECK_TD = r'<td>(?:<[^>]*>| )*([^<]*)' + LINKCHECK_TD = r'<td>(?:<.*?>| )*([^<]*)' - CAPTCHA_KEY_PATTERN = r'var reCAPTCHA_publickey=\'(.+?)\'' - LONG_WAIT_PATTERN = r'<li class="title">You need to wait (\d+) (\w+) to start another download\.</li>' - LINK_EXPIRED_PATTERN = r'Your download link has expired' - DAILY_LIMIT_PATTERN = r'Your daily download limit has been reached' + CAPTCHA_KEY_PATTERN = r'var reCAPTCHA_publickey=\'(.+?)\'' + LONG_WAIT_PATTERN = r'<li class="title">You need to wait (\d+) (\w+) to start another download\.</li>' + LINK_EXPIRED_PATTERN = r'Your download link has expired' + DL_LIMIT_PATTERN = r'Your daily download limit has been reached' NOT_LOGGED_IN_PATTERN = r'<form (name="loginDialogBoxForm"|id="login_form")|<li><a href="/login\.php">Login</a></li>' @@ -119,7 +121,7 @@ class FileserveCom(Hoster): check = self.checkDownload({"expired": self.LINK_EXPIRED_PATTERN, "wait" : re.compile(self.LONG_WAIT_PATTERN), - "limit" : self.DAILY_LIMIT_PATTERN}) + "limit" : self.DL_LIMIT_PATTERN}) if check == "expired": self.logDebug("Download link was expired") @@ -161,7 +163,7 @@ class FileserveCom(Hoster): recaptcha = ReCaptcha(self) for _i in xrange(5): - challenge, response = recaptcha.challenge(captcha_key) + response, challenge = recaptcha.challenge(captcha_key) res = json_loads(self.load(self.URLS[2], post={'recaptcha_challenge_field' : challenge, 'recaptcha_response_field' : response, |