From 59d2ad3541bf133ddd69fd3b7c633e7e226e4829 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 01:08:35 +0200 Subject: Spare improvements and fixes --- module/plugins/hoster/FileserveCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index a74589cff..12f5bf2c3 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -33,7 +33,7 @@ def check_file(plugin, urls): class FileserveCom(Hoster): __name__ = "FileserveCom" __type__ = "hoster" - __version__ = "0.58" + __version__ = "0.59" __status__ = "testing" __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P[^/]+)' @@ -94,7 +94,7 @@ class FileserveCom(Hoster): elif action['fail'] == "parallelDownload": self.log_warning(_("Parallel download error, now waiting 60s")) - self.retry(wait_time=60, reason=_("parallelDownload")) + self.retry(wait_time=60, msg=_("parallelDownload")) else: self.fail(_("Download check returned: %s") % action['fail']) @@ -206,7 +206,7 @@ class FileserveCom(Hoster): if not premium_url and self.check_download({'login': re.compile(self.NOT_LOGGED_IN_PATTERN)}): self.account.relogin(self.user) - self.retry(reason=_("Not logged in")) + self.retry(msg=_("Not logged in")) def get_info(urls): -- cgit v1.2.3 From f9fc367427e30b7a3ca2ccad6144cb76b21f0257 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 14:36:22 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/FileserveCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 12f5bf2c3..c35fab3fc 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -24,6 +24,7 @@ def check_file(plugin, urls): parse_size(cols[2]) if cols[2] != '--' else 0, 2 if cols[3].startswith('Available') else 1, cols[0])) + except Exception, e: continue -- cgit v1.2.3 From 3353ea228835ffa96cc73d5b5e23f6d92ba84203 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 29 Sep 2015 22:43:17 +0200 Subject: Update hoster plugins --- module/plugins/hoster/FileserveCom.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index c35fab3fc..36ccd473f 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -34,7 +34,7 @@ def check_file(plugin, urls): class FileserveCom(Hoster): __name__ = "FileserveCom" __type__ = "hoster" - __version__ = "0.59" + __version__ = "0.60" __status__ = "testing" __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P[^/]+)' @@ -95,7 +95,7 @@ class FileserveCom(Hoster): elif action['fail'] == "parallelDownload": self.log_warning(_("Parallel download error, now waiting 60s")) - self.retry(wait_time=60, msg=_("parallelDownload")) + self.retry(delay=60, msg=_("parallelDownload")) else: self.fail(_("Download check returned: %s") % action['fail']) @@ -120,7 +120,7 @@ class FileserveCom(Hoster): self.download(self.url, post={'download': "normal"}) self.log_debug(self.req.http.lastEffectiveURL) - check = self.check_download({'expired': self.LINK_EXPIRED_PATTERN, + check = self.check_file({'expired': self.LINK_EXPIRED_PATTERN, 'wait' : re.compile(self.LONG_WAIT_PATTERN), 'limit' : self.DL_LIMIT_PATTERN}) @@ -133,7 +133,7 @@ class FileserveCom(Hoster): elif check == "limit": self.log_warning(_("Download limited reached for today")) - self.wait(seconds_to_midnight(gmt=2), True) + self.wait(seconds_to_midnight(), True) self.retry() self.thread.m.reconnecting.wait(3) #: Ease issue with later downloads appearing to be in parallel @@ -187,8 +187,8 @@ class FileserveCom(Hoster): if self.__name__ == "FileserveCom": #: Try api download res = self.load("http://app.fileserve.com/api/download/premium/", - post={'username': self.user, - 'password': self.account.get_info(self.user)['login']['password'], + post={'username': self.account.user, + 'password': self.account.get_login('password'), 'shorten': self.file_id}) if res: res = json_loads(res) @@ -205,8 +205,8 @@ class FileserveCom(Hoster): self.download(premium_url or self.pyfile.url) - if not premium_url and self.check_download({'login': re.compile(self.NOT_LOGGED_IN_PATTERN)}): - self.account.relogin(self.user) + if not premium_url and self.check_file({'login': re.compile(self.NOT_LOGGED_IN_PATTERN)}): + self.account.relogin() self.retry(msg=_("Not logged in")) -- cgit v1.2.3 From 25d5726d4953b93a2e286fd6af8d4ead20670ba6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 1 Oct 2015 04:55:17 +0200 Subject: A lot of plugin code cosmetics --- module/plugins/hoster/FileserveCom.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 36ccd473f..903e10349 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -95,7 +95,7 @@ class FileserveCom(Hoster): elif action['fail'] == "parallelDownload": self.log_warning(_("Parallel download error, now waiting 60s")) - self.retry(delay=60, msg=_("parallelDownload")) + self.retry(wait=60, msg=_("parallelDownload")) else: self.fail(_("Download check returned: %s") % action['fail']) @@ -161,19 +161,15 @@ class FileserveCom(Hoster): captcha_key = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group(1) recaptcha = ReCaptcha(self) - for _i in xrange(5): - response, challenge = recaptcha.challenge(captcha_key) - res = json_loads(self.load(self.URLS[2], - post={'recaptcha_challenge_field' : challenge, - 'recaptcha_response_field' : response, - 'recaptcha_shortencode_field': self.file_id})) - if not res['success']: - self.captcha.invalid() - else: - self.captcha.correct() - break + response, challenge = recaptcha.challenge(captcha_key) + res = json_loads(self.load(self.URLS[2], + post={'recaptcha_challenge_field' : challenge, + 'recaptcha_response_field' : response, + 'recaptcha_shortencode_field': self.file_id})) + if res['success']: + self.captcha.correct() else: - self.fail(_("Invalid captcha")) + self.retry_captcha() def do_long_wait(self, m): -- cgit v1.2.3 From 8d85a655d8cc408574f471306613bc05115c8c64 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 1 Oct 2015 18:59:55 +0200 Subject: Improve Hoster and Crypter + general fixup --- module/plugins/hoster/FileserveCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FileserveCom.py') diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 903e10349..277d4f2a8 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -34,7 +34,7 @@ def check_file(plugin, urls): class FileserveCom(Hoster): __name__ = "FileserveCom" __type__ = "hoster" - __version__ = "0.60" + __version__ = "0.61" __status__ = "testing" __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P[^/]+)' @@ -193,7 +193,7 @@ class FileserveCom(Hoster): elif res['error_code'] in ["305", "500"]: self.temp_offline() elif res['error_code'] in ["403", "605"]: - self.restart(nopremium=True) + self.restart() elif res['error_code'] in ["606", "607", "608"]: self.offline() else: -- cgit v1.2.3