From 654f816389e2a91f82d9569b4a12fb5f7c356545 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 18:05:16 +0200 Subject: Use "is" instead "==" for bool condition check --- module/plugins/hoster/MegacrypterCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/MegacrypterCom.py') diff --git a/module/plugins/hoster/MegacrypterCom.py b/module/plugins/hoster/MegacrypterCom.py index ee6be39a2..9fcf40214 100644 --- a/module/plugins/hoster/MegacrypterCom.py +++ b/module/plugins/hoster/MegacrypterCom.py @@ -36,7 +36,7 @@ class MegacrypterCom(MegaNz): dl = self.callApi(link=node, m="dl") # TODO: map error codes, implement password protection - # if info["pass"] == True: + # if info["pass"] is True: # crypted_file_key, md5_file_key = info["key"].split("#") key = self.b64_decode(info["key"]) -- cgit v1.2.3 From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/hoster/MegacrypterCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/MegacrypterCom.py') diff --git a/module/plugins/hoster/MegacrypterCom.py b/module/plugins/hoster/MegacrypterCom.py index 9fcf40214..378acd856 100644 --- a/module/plugins/hoster/MegacrypterCom.py +++ b/module/plugins/hoster/MegacrypterCom.py @@ -12,8 +12,8 @@ class MegacrypterCom(MegaNz): __pattern__ = r'(https?://[a-z0-9]{0,10}\.?megacrypter\.com/[a-zA-Z0-9!_\-]+)' __version__ = "0.2" __description__ = """Megacrypter.com decrypter plugin""" - __author_name__ = ("GonzaloSR", ) - __author_mail__ = ("gonzalo@gonzalosr.com", ) + __author_name__ = "GonzaloSR" + __author_mail__ = "gonzalo@gonzalosr.com" API_URL = "http://megacrypter.com/api" FILE_SUFFIX = ".crypted" -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hoster/MegacrypterCom.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/MegacrypterCom.py') diff --git a/module/plugins/hoster/MegacrypterCom.py b/module/plugins/hoster/MegacrypterCom.py index 378acd856..aa167ba30 100644 --- a/module/plugins/hoster/MegacrypterCom.py +++ b/module/plugins/hoster/MegacrypterCom.py @@ -36,15 +36,15 @@ class MegacrypterCom(MegaNz): dl = self.callApi(link=node, m="dl") # TODO: map error codes, implement password protection - # if info["pass"] is True: - # crypted_file_key, md5_file_key = info["key"].split("#") + # if info['pass'] is True: + # crypted_file_key, md5_file_key = info['key'].split("#") - key = self.b64_decode(info["key"]) + key = self.b64_decode(info['key']) - pyfile.name = info["name"] + self.FILE_SUFFIX + pyfile.name = info['name'] + self.FILE_SUFFIX - self.download(dl["url"]) + self.download(dl['url']) self.decryptFile(key) # Everything is finished and final name can be set - pyfile.name = info["name"] + pyfile.name = info['name'] -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/MegacrypterCom.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/MegacrypterCom.py') diff --git a/module/plugins/hoster/MegacrypterCom.py b/module/plugins/hoster/MegacrypterCom.py index aa167ba30..7a86dbf70 100644 --- a/module/plugins/hoster/MegacrypterCom.py +++ b/module/plugins/hoster/MegacrypterCom.py @@ -9,8 +9,10 @@ from module.plugins.hoster.MegaNz import MegaNz class MegacrypterCom(MegaNz): __name__ = "MegacrypterCom" __type__ = "hoster" - __pattern__ = r'(https?://[a-z0-9]{0,10}\.?megacrypter\.com/[a-zA-Z0-9!_\-]+)' __version__ = "0.2" + + __pattern__ = r'(https?://[a-z0-9]{0,10}\.?megacrypter\.com/[a-zA-Z0-9!_\-]+)' + __description__ = """Megacrypter.com decrypter plugin""" __author_name__ = "GonzaloSR" __author_mail__ = "gonzalo@gonzalosr.com" @@ -18,6 +20,7 @@ class MegacrypterCom(MegaNz): API_URL = "http://megacrypter.com/api" FILE_SUFFIX = ".crypted" + def callApi(self, **kwargs): """ Dispatch a call to the api, see megacrypter.com/api_doc """ self.logDebug("JSON request: " + json_dumps(kwargs)) -- cgit v1.2.3