From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/crypter/LinkSaveIn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 85dde6c87..13277e3f3 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -27,7 +27,7 @@ class LinkSaveIn(Crypter): # Constants _JK_KEY_ = "jk" _CRYPTED_KEY_ = "crypted" - HOSTER_DOMAIN = "linksave.in" + HOSTER_NAME = "linksave.in" def setup(self): self.html = None @@ -41,7 +41,7 @@ class LinkSaveIn(Crypter): # Init self.package = pyfile.package() self.fileid = re.match(self.__pattern__, pyfile.url).group('id') - self.req.cj.setCookie(self.HOSTER_DOMAIN, "Linksave_Language", "english") + self.req.cj.setCookie(self.HOSTER_NAME, "Linksave_Language", "english") # Request package self.html = self.load(pyfile.url) -- 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/crypter/LinkSaveIn.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 13277e3f3..e4497eb09 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -37,7 +37,6 @@ class LinkSaveIn(Crypter): self.preferred_sources = ['cnl2', 'rsdf', 'ccf', 'dlc', 'web'] def decrypt(self, pyfile): - # Init self.package = pyfile.package() self.fileid = re.match(self.__pattern__, pyfile.url).group('id') @@ -124,11 +123,11 @@ class LinkSaveIn(Crypter): self.correctCaptcha() def handleLinkSource(self, type_): - if type_ == 'cnl2': + if type_ == "cnl2": return self.handleCNL2() - elif type_ in ('rsdf', 'ccf', 'dlc'): + elif type_ in ("rsdf", "ccf", "dlc"): return self.handleContainer(type_) - elif type_ == 'web': + elif type_ == "web": return self.handleWebLinks() else: self.fail('unknown source type "%s" (this is probably a bug)' % type_) @@ -189,7 +188,6 @@ class LinkSaveIn(Crypter): return package_links def _getCipherParams(self): - # Get jk jk_re = r' Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/crypter/LinkSaveIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index e4497eb09..5fde4e958 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -34,7 +34,7 @@ class LinkSaveIn(Crypter): self.fileid = None self.captcha = False self.package = None - self.preferred_sources = ['cnl2', 'rsdf', 'ccf', 'dlc', 'web'] + self.preferred_sources = ["cnl2", "rsdf", "ccf", "dlc", "web"] def decrypt(self, pyfile): # Init -- cgit v1.2.3 From 8e47b0de30a25d0fd5dfb518bfe4e1e7beff93fd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/crypter/LinkSaveIn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 5fde4e958..6e024c766 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -17,9 +17,11 @@ from module.unescape import unescape class LinkSaveIn(Crypter): __name__ = "LinkSaveIn" + __version__ = "2.01" __type__ = "crypter" + __pattern__ = r'http://(?:www\.)?linksave.in/(?P\w+)$' - __version__ = "2.01" + __description__ = """LinkSave.in decrypter plugin""" __author_name__ = "fragonib" __author_mail__ = "fragonib[AT]yahoo[DOT]es" @@ -29,6 +31,7 @@ class LinkSaveIn(Crypter): _CRYPTED_KEY_ = "crypted" HOSTER_NAME = "linksave.in" + def setup(self): self.html = None self.fileid = None -- 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/crypter/LinkSaveIn.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 6e024c766..060a434d2 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- - # -# v2.01 - hagg # * cnl2 and web links are skipped if JS is not available (instead of failing the package) # * only best available link source is used (priority: cnl2>rsdf>ccf>dlc>web -# import base64 import binascii @@ -17,8 +14,8 @@ from module.unescape import unescape class LinkSaveIn(Crypter): __name__ = "LinkSaveIn" - __version__ = "2.01" __type__ = "crypter" + __version__ = "2.01" __pattern__ = r'http://(?:www\.)?linksave.in/(?P\w+)$' -- cgit v1.2.3