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/LetitbitNet.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/LetitbitNet.py') diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index e93b60460..22d5c654a 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -35,7 +35,7 @@ def get_info(urls): class LetitbitNet(SimpleHoster): __name__ = "LetitbitNet" __type__ = "hoster" - __version__ = "0.32" + __version__ = "0.33" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(letitbit|shareflare)\.net/download/.+' @@ -104,7 +104,7 @@ class LetitbitNet(SimpleHoster): if res == "error_free_download_blocked": self.log_warning(_("Daily limit reached")) - self.wait(seconds_to_midnight(gmt=2), True) + self.wait(seconds_to_midnight(), True) if res == "error_wrong_captcha": self.captcha.invalid() @@ -123,10 +123,9 @@ class LetitbitNet(SimpleHoster): def handle_premium(self, pyfile): - api_key = self.user - premium_key = self.account.get_info(self.user)['login']['password'] + premium_key = self.account.get_login('password') - json_data = [api_key, ["download/direct_links", {'pass': premium_key, 'link': pyfile.url}]] + json_data = [self.account.user, ["download/direct_links", {'pass': premium_key, 'link': pyfile.url}]] api_rep = self.load('http://api.letitbit.net/json', post={'r': json_dumps(json_data)}) self.log_debug("API Data: " + api_rep) api_rep = json_loads(api_rep) -- 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/LetitbitNet.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster/LetitbitNet.py') diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index 22d5c654a..b8a563007 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -60,7 +60,7 @@ class LetitbitNet(SimpleHoster): def handle_free(self, pyfile): action, inputs = self.parse_html_form('id="ifree_form"') if not action: - self.error(_("ifree_form")) + self.error(_("Form not found")) pyfile.size = float(inputs['sssize']) self.log_debug(action, inputs) @@ -99,17 +99,13 @@ class LetitbitNet(SimpleHoster): self.log_debug(res) - if not res: - self.captcha.invalid() + if not res or res == "error_wrong_captcha": + self.retry_captcha() - if res == "error_free_download_blocked": + elif res == "error_free_download_blocked": self.log_warning(_("Daily limit reached")) self.wait(seconds_to_midnight(), True) - if res == "error_wrong_captcha": - self.captcha.invalid() - self.retry() - elif res.startswith('['): urls = json_loads(res) -- cgit v1.2.3