From 91e57e29c211706f4c9768b737ad900cf0305088 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 20 Mar 2015 11:58:02 +0100 Subject: [DepositfilesCom] Fix https://github.com/pyload/pyload/issues/1268 --- module/plugins/hoster/DepositfilesCom.py | 59 ++++++++++---------------------- 1 file changed, 19 insertions(+), 40 deletions(-) (limited to 'module/plugins/hoster/DepositfilesCom.py') diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 6de05af9a..450852477 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DepositfilesCom(SimpleHoster): __name__ = "DepositfilesCom" __type__ = "hoster" - __version__ = "0.53" + __version__ = "0.54" __pattern__ = r'https?://(?:www\.)?(depositfiles\.com|dfiles\.(eu|ru))(/\w{1,3})?/files/(?P\w+)' @@ -32,32 +32,18 @@ class DepositfilesCom(SimpleHoster): COOKIES = [("dfiles.eu", "lang_current", "en")] + WAIT_PATTERN = r'(?:download_waiter_remain">|html_download_api-limit_interval">|>Please wait|>Try in).+' + ERROR_PATTER = r'File is checked, please try again in a minute' + LINK_FREE_PATTERN = r'
(\d+)', self.html) - if wait: - wait_time = int(wait.group(1)) - self.logInfo(_("Traffic used up. Waiting %d seconds") % wait_time) - self.wait(wait_time, True) - self.retry() + self.html = self.load(pyfile.url, post={'gateway_result': "1"}) - wait = re.search(r'>Try in (\d+) minutes or use GOLD account', self.html) - if wait: - wait_time = int(wait.group(1)) - self.logInfo(_("All free slots occupied. Waiting %d minutes") % wait_time) - self.setWait(wait_time * 60, False) - - wait = re.search(r'Please wait (\d+) sec', self.html) - if wait: - self.setWait(int(wait.group(1))) + self.checkErrors() m = re.search(r"var fid = '(\w+)';", self.html) if m is None: @@ -69,38 +55,31 @@ class DepositfilesCom(SimpleHoster): recaptcha = ReCaptcha(self) captcha_key = recaptcha.detect_key() if captcha_key is None: - self.error(_("ReCaptcha key not found")) + return + + self.html = self.load("https://dfiles.eu/get_file.php", get=params) - for _i in xrange(5): + if '' in self.html: self.logWarning(_("Download limit reached")) self.retry(25, 60 * 60, "Download limit reached") + elif 'onClick="show_gold_offer' in self.html: self.account.relogin(self.user) self.retry() + else: link = re.search(self.LINK_PREMIUM_PATTERN, self.html) mirror = re.search(self.LINK_MIRROR_PATTERN, self.html) -- cgit v1.2.3