From 2945a72664d4b6e8ca6b50fa8efde483edfb9723 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 27 Jun 2014 00:59:12 +0200 Subject: Spare fixes --- 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 8b72606ce..ee6be39a2 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"] == True: # crypted_file_key, md5_file_key = info["key"].split("#") key = self.b64_decode(info["key"]) -- cgit v1.2.3 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 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- 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 7a86dbf70..56a84da69 100644 --- a/module/plugins/hoster/MegacrypterCom.py +++ b/module/plugins/hoster/MegacrypterCom.py @@ -14,8 +14,8 @@ class MegacrypterCom(MegaNz): __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" + __authors__ = [("GonzaloSR", "gonzalo@gonzalosr.com")] + API_URL = "http://megacrypter.com/api" FILE_SUFFIX = ".crypted" -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/MegacrypterCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/MegacrypterCom.py') diff --git a/module/plugins/hoster/MegacrypterCom.py b/module/plugins/hoster/MegacrypterCom.py index 56a84da69..855fba9b2 100644 --- a/module/plugins/hoster/MegacrypterCom.py +++ b/module/plugins/hoster/MegacrypterCom.py @@ -14,6 +14,7 @@ class MegacrypterCom(MegaNz): __pattern__ = r'(https?://[a-z0-9]{0,10}\.?megacrypter\.com/[a-zA-Z0-9!_\-]+)' __description__ = """Megacrypter.com decrypter plugin""" + __license__ = "GPLv3" __authors__ = [("GonzaloSR", "gonzalo@gonzalosr.com")] -- cgit v1.2.3 From f76e5c2336718dca9da8033ba22cd83c72c7b3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:14:28 +0200 Subject: Pattern update 1 --- 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 855fba9b2..67dec2a0b 100644 --- a/module/plugins/hoster/MegacrypterCom.py +++ b/module/plugins/hoster/MegacrypterCom.py @@ -11,7 +11,7 @@ class MegacrypterCom(MegaNz): __type__ = "hoster" __version__ = "0.2" - __pattern__ = r'(https?://[a-z0-9]{0,10}\.?megacrypter\.com/[a-zA-Z0-9!_\-]+)' + __pattern__ = r'(https?://\w{0,10}\.?megacrypter\.com/[\w!-]+)' __description__ = """Megacrypter.com decrypter plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hoster/MegacrypterCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/MegacrypterCom.py') diff --git a/module/plugins/hoster/MegacrypterCom.py b/module/plugins/hoster/MegacrypterCom.py index 67dec2a0b..5464dedce 100644 --- a/module/plugins/hoster/MegacrypterCom.py +++ b/module/plugins/hoster/MegacrypterCom.py @@ -29,6 +29,7 @@ class MegacrypterCom(MegaNz): self.logDebug("API Response: " + resp) return json_loads(resp) + def process(self, pyfile): # match is guaranteed because plugin was chosen to handle url node = re.match(self.__pattern__, pyfile.url).group(1) -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/MegacrypterCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/MegacrypterCom.py') diff --git a/module/plugins/hoster/MegacrypterCom.py b/module/plugins/hoster/MegacrypterCom.py index 5464dedce..ad74445f5 100644 --- a/module/plugins/hoster/MegacrypterCom.py +++ b/module/plugins/hoster/MegacrypterCom.py @@ -7,15 +7,15 @@ from module.plugins.hoster.MegaNz import MegaNz class MegacrypterCom(MegaNz): - __name__ = "MegacrypterCom" - __type__ = "hoster" + __name__ = "MegacrypterCom" + __type__ = "hoster" __version__ = "0.2" __pattern__ = r'(https?://\w{0,10}\.?megacrypter\.com/[\w!-]+)' __description__ = """Megacrypter.com decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("GonzaloSR", "gonzalo@gonzalosr.com")] + __license__ = "GPLv3" + __authors__ = [("GonzaloSR", "gonzalo@gonzalosr.com")] API_URL = "http://megacrypter.com/api" -- cgit v1.2.3 From 776a6ced27fa0fe813871dda61b8eee869e8355d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 7 Nov 2014 19:36:02 +0100 Subject: Rename MegaNz to MegaCoNz --- module/plugins/hoster/MegacrypterCom.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/MegacrypterCom.py') diff --git a/module/plugins/hoster/MegacrypterCom.py b/module/plugins/hoster/MegacrypterCom.py index ad74445f5..a097ca506 100644 --- a/module/plugins/hoster/MegacrypterCom.py +++ b/module/plugins/hoster/MegacrypterCom.py @@ -3,13 +3,14 @@ import re from module.common.json_layer import json_loads, json_dumps -from module.plugins.hoster.MegaNz import MegaNz +from module.plugins.hoster.MegaCoNz import MegaCoNz -class MegacrypterCom(MegaNz): + +class MegacrypterCom(MegaCoNz): __name__ = "MegacrypterCom" __type__ = "hoster" - __version__ = "0.2" + __version__ = "0.21" __pattern__ = r'(https?://\w{0,10}\.?megacrypter\.com/[\w!-]+)' -- cgit v1.2.3 From 59f72bfc5ed721c80c821bd0ca1bc8daf0d49880 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 9 Nov 2014 03:12:41 +0100 Subject: Code cosmetics --- module/plugins/hoster/MegacrypterCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/MegacrypterCom.py') diff --git a/module/plugins/hoster/MegacrypterCom.py b/module/plugins/hoster/MegacrypterCom.py index a097ca506..4034f7d32 100644 --- a/module/plugins/hoster/MegacrypterCom.py +++ b/module/plugins/hoster/MegacrypterCom.py @@ -26,9 +26,9 @@ class MegacrypterCom(MegaCoNz): def callApi(self, **kwargs): """ Dispatch a call to the api, see megacrypter.com/api_doc """ self.logDebug("JSON request: " + json_dumps(kwargs)) - resp = self.load(self.API_URL, post=json_dumps(kwargs)) - self.logDebug("API Response: " + resp) - return json_loads(resp) + res = self.load(self.API_URL, post=json_dumps(kwargs)) + self.logDebug("API Response: " + res) + return json_loads(res) def process(self, pyfile): -- cgit v1.2.3