From c02cb47b919e12534f862028be7d0996e8f375d8 Mon Sep 17 00:00:00 2001 From: GamaC0de Date: Wed, 10 Aug 2016 19:05:55 +0300 Subject: [MegaCoNz] Cosmetic change --- module/plugins/hoster/MegaCoNz.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index a553655bb..a86848438 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -225,7 +225,7 @@ class MegaClient(object): class MegaCoNz(Hoster): __name__ = "MegaCoNz" __type__ = "hoster" - __version__ = "0.45" + __version__ = "0.46" __status__ = "testing" __pattern__ = r'(https?://(?:www\.)?mega(\.co)?\.nz/|mega:|chrome:.+?)#(?PN|)!(?P[\w^_]+)!(?P[\w\-,=]+)(?:###n=(?P[\w^_]+))?' @@ -307,9 +307,11 @@ class MegaCoNz(Hoster): def checksum_failed(self, local_file, msg): check_action = self.config.get("check_action", default="retry", plugin="Checksum") + if check_action == "retry": max_tries = self.config.get("max_tries", default=2, plugin="Checksum") retry_action = self.config.get("retry_action", default="fail", plugin="Checksum") + if all(_r < max_tries for _id, _r in self.retries.items()): os.remove(local_file) wait_time = self.config.get("wait_time", default=1, plugin="Checksum") @@ -340,7 +342,7 @@ class MegaCoNz(Hoster): name) if exists(dest_file): self.pyfile.name = name - self.skip("File exists.") + self.skip(_("File exists.")) def process(self, pyfile): @@ -361,7 +363,7 @@ class MegaCoNz(Hoster): key = MegaCrypto.base64_to_a32(key) if len(key) != 8: self.log_error(_("Invalid key length")) - self.fail("Invalid key length") + self.fail(_("Invalid key length")) mega = MegaClient(self, self.info['pattern']['OWNER'] or self.info['pattern']['ID']) @@ -395,7 +397,7 @@ class MegaCoNz(Hoster): time_left = res.get('tl', 0) if time_left: self.log_warning(_("Free download limit reached")) - self.retry(wait=time_left, msg="Free download limit reached") + self.retry(wait=time_left, msg=_("Free download limit reached")) # self.req.http.c.setopt(pycurl.SSL_CIPHER_LIST, "RC4-MD5:DEFAULT") -- cgit v1.2.3