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 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/crypter/LinkSaveIn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 060a434d2..e80686c02 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -136,7 +136,7 @@ class LinkSaveIn(Crypter): package_links = [] self.logDebug("Search for Web links") if not self.js: - self.logDebug("no JS -> skip Web links") + self.logDebug("No JS -> skip Web links") else: #@TODO: Gather paginated web links pattern = r' skip CNL2 links") + self.logDebug("No JS -> skip CNL2 links") elif 'cnl2_load' in self.html: try: (vcrypted, vjk) = self._getCipherParams() -- cgit v1.2.3 From 40c01be326e336cd582db935cf53bc06e8f17b3c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 5 Oct 2014 01:51:08 +0200 Subject: [LinkSaveIn] Now SimpleCrypter based --- module/plugins/crypter/LinkSaveIn.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index e80686c02..8b2b02ea6 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -8,14 +8,15 @@ import binascii import re from Crypto.Cipher import AES -from module.plugins.Crypter import Crypter + +from module.plugins.internal.SimpleCrypter import SimpleCrypter from module.unescape import unescape -class LinkSaveIn(Crypter): +class LinkSaveIn(SimpleCrypter): __name__ = "LinkSaveIn" __type__ = "crypter" - __version__ = "2.01" + __version__ = "2.02" __pattern__ = r'http://(?:www\.)?linksave.in/(?P\w+)$' @@ -23,10 +24,12 @@ class LinkSaveIn(Crypter): __author_name__ = "fragonib" __author_mail__ = "fragonib[AT]yahoo[DOT]es" + + COOKIES = [(".linksave.in", "Linksave_Language", "english")] + # Constants _JK_KEY_ = "jk" _CRYPTED_KEY_ = "crypted" - HOSTER_NAME = "linksave.in" def setup(self): @@ -36,11 +39,11 @@ class LinkSaveIn(Crypter): self.package = None 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') - self.req.cj.setCookie(self.HOSTER_NAME, "Linksave_Language", "english") # Request package self.html = self.load(pyfile.url) @@ -74,41 +77,48 @@ class LinkSaveIn(Crypter): else: self.fail('Could not extract any links') + def isOnline(self): if "Error 404 - Folder not found!" in self.html: self.logDebug("File not found") return False return True + def isPasswordProtected(self): if re.search(r'''Captcha:" in self.html: self.logDebug("Links are captcha protected") return True return False + def unlockPasswordProtection(self): password = self.getPassword() self.logDebug("Submitting password [%s] for protected links" % password) post = {"id": self.fileid, "besucherpasswort": password, 'login': 'submit'} self.html = self.load(self.pyfile.url, post=post) + def unlockCaptchaProtection(self): captcha_hash = re.search(r'name="hash" value="([^"]+)', self.html).group(1) captcha_url = re.search(r'src=".(/captcha/cap.php\?hsh=[^"]+)', self.html).group(1) captcha_code = self.decryptCaptcha("http://linksave.in" + captcha_url, forceUser=True) self.html = self.load(self.pyfile.url, post={"id": self.fileid, "hash": captcha_hash, "code": captcha_code}) + def getPackageInfo(self): name = self.pyfile.package().name folder = self.pyfile.package().folder self.logDebug("Defaulting to pyfile name [%s] and folder [%s] for package" % (name, folder)) return name, folder + def handleErrors(self): if "The visitorpassword you have entered is wrong" in self.html: self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") @@ -122,6 +132,7 @@ class LinkSaveIn(Crypter): else: self.correctCaptcha() + def handleLinkSource(self, type_): if type_ == "cnl2": return self.handleCNL2() @@ -132,6 +143,7 @@ class LinkSaveIn(Crypter): else: self.fail('unknown source type "%s" (this is probably a bug)' % type_) + def handleWebLinks(self): package_links = [] self.logDebug("Search for Web links") @@ -159,6 +171,7 @@ class LinkSaveIn(Crypter): self.logDebug("Error decrypting Web link %s, %s" % (webLink, detail)) return package_links + def handleContainer(self, type_): package_links = [] type_ = type_.lower() @@ -173,6 +186,7 @@ class LinkSaveIn(Crypter): package_links.append(link) return package_links + def handleCNL2(self): package_links = [] self.logDebug("Search for CNL2 links") @@ -187,6 +201,7 @@ class LinkSaveIn(Crypter): self.fail("Unable to decrypt CNL2 links") return package_links + def _getCipherParams(self): # Get jk jk_re = r' 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/crypter/LinkSaveIn.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 8b2b02ea6..9c0bbdeac 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -21,8 +21,7 @@ class LinkSaveIn(SimpleCrypter): __pattern__ = r'http://(?:www\.)?linksave.in/(?P\w+)$' __description__ = """LinkSave.in decrypter plugin""" - __author_name__ = "fragonib" - __author_mail__ = "fragonib[AT]yahoo[DOT]es" + __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es")] COOKIES = [(".linksave.in", "Linksave_Language", "english")] -- 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/crypter/LinkSaveIn.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 9c0bbdeac..b4691d70b 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -21,6 +21,7 @@ class LinkSaveIn(SimpleCrypter): __pattern__ = r'http://(?:www\.)?linksave.in/(?P\w+)$' __description__ = """LinkSave.in decrypter plugin""" + __license__ = "GPLv3" __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es")] -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 2 --- 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 b4691d70b..af3679122 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -18,7 +18,7 @@ class LinkSaveIn(SimpleCrypter): __type__ = "crypter" __version__ = "2.02" - __pattern__ = r'http://(?:www\.)?linksave.in/(?P\w+)$' + __pattern__ = r'http://(?:www\.)?linksave\.in/(?P\w+)$' __description__ = """LinkSave.in decrypter plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 8939f015a688a07ec7d0bd14b6a3704f6a2cb4a0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:12:40 +0200 Subject: Pattern update 3 --- 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 af3679122..81768e457 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -178,7 +178,7 @@ class LinkSaveIn(SimpleCrypter): self.logDebug("Seach for %s Container links" % type_.upper()) if not type_.isalnum(): # check to prevent broken re-pattern (cnl2,rsdf,ccf,dlc,web are all alpha-numeric) self.fail('unknown container type "%s" (this is probably a bug)' % type_) - pattern = r"\('%s_link'\).href=unescape\('(.*?\.%s)'\)" % (type_, type_) + pattern = r'\(\'%s_link\'\).href=unescape\(\'(.*?\.%s)\'\)' % (type_, type_) containersLinks = re.findall(pattern, self.html) self.logDebug("Found %d %s Container links" % (len(containersLinks), type_.upper())) for containerLink in containersLinks: -- cgit v1.2.3 From dabee359dd8c3870e0302e99457e6dd1bb93d736 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 21 Oct 2014 16:01:05 +0200 Subject: Remove needless self.html --- module/plugins/crypter/LinkSaveIn.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 81768e457..3e37f3610 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -33,7 +33,6 @@ class LinkSaveIn(SimpleCrypter): def setup(self): - self.html = None self.fileid = None self.captcha = False self.package = None -- cgit v1.2.3 From 8cde8385b0224f8fa26758f6c2b6b782e5fb3663 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 23 Oct 2014 22:34:36 +0200 Subject: Call error instead fail in some plugins --- 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 3e37f3610..e601e8173 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -140,7 +140,7 @@ class LinkSaveIn(SimpleCrypter): elif type_ == "web": return self.handleWebLinks() else: - self.fail('unknown source type "%s" (this is probably a bug)' % type_) + self.error('unknown source type "%s" (this is probably a bug)' % type_) def handleWebLinks(self): @@ -176,7 +176,7 @@ class LinkSaveIn(SimpleCrypter): type_ = type_.lower() self.logDebug("Seach for %s Container links" % type_.upper()) if not type_.isalnum(): # check to prevent broken re-pattern (cnl2,rsdf,ccf,dlc,web are all alpha-numeric) - self.fail('unknown container type "%s" (this is probably a bug)' % type_) + self.error('unknown container type "%s" (this is probably a bug)' % type_) pattern = r'\(\'%s_link\'\).href=unescape\(\'(.*?\.%s)\'\)' % (type_, type_) containersLinks = re.findall(pattern, self.html) self.logDebug("Found %d %s Container links" % (len(containersLinks), type_.upper())) -- cgit v1.2.3 From 4da90891eb2544ac15a7d512aba8cb357f68ee5f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 01:11:29 +0200 Subject: Spare code cosmetics --- module/plugins/crypter/LinkSaveIn.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index e601e8173..b22d87f38 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -125,7 +125,6 @@ class LinkSaveIn(SimpleCrypter): if self.captcha: if "Wrong code. Please retry" in self.html: - self.logDebug("Invalid captcha, retrying") self.invalidCaptcha() self.retry() else: @@ -140,7 +139,7 @@ class LinkSaveIn(SimpleCrypter): elif type_ == "web": return self.handleWebLinks() else: - self.error('unknown source type "%s" (this is probably a bug)' % type_) + self.error('Unknown source type "%s" (this is probably a bug)' % type_) def handleWebLinks(self): @@ -176,7 +175,7 @@ class LinkSaveIn(SimpleCrypter): type_ = type_.lower() self.logDebug("Seach for %s Container links" % type_.upper()) if not type_.isalnum(): # check to prevent broken re-pattern (cnl2,rsdf,ccf,dlc,web are all alpha-numeric) - self.error('unknown container type "%s" (this is probably a bug)' % type_) + self.error('Unknown container type "%s" (this is probably a bug)' % type_) pattern = r'\(\'%s_link\'\).href=unescape\(\'(.*?\.%s)\'\)' % (type_, type_) containersLinks = re.findall(pattern, self.html) self.logDebug("Found %d %s Container links" % (len(containersLinks), type_.upper())) -- cgit v1.2.3 From e3f5280529921100f48bb8a79853bf480c7611e4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 02:53:05 +0200 Subject: Replace single quotes with doubles in self.error and self.fail msg --- 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 b22d87f38..96d737382 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -74,7 +74,7 @@ class LinkSaveIn(SimpleCrypter): if package_links: self.packages = [(package_name, package_links, folder_name)] else: - self.fail('Could not extract any links') + self.fail("Could not extract any links") def isOnline(self): -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/crypter/LinkSaveIn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 96d737382..aa340f873 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -74,7 +74,7 @@ class LinkSaveIn(SimpleCrypter): if package_links: self.packages = [(package_name, package_links, folder_name)] else: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) def isOnline(self): @@ -121,7 +121,7 @@ class LinkSaveIn(SimpleCrypter): def handleErrors(self): if "The visitorpassword you have entered is wrong" in self.html: self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry") - self.fail("Incorrect password, please set right password on 'Edit package' form and retry") + self.fail(_("Incorrect password, please set right password on 'Edit package' form and retry")) if self.captcha: if "Wrong code. Please retry" in self.html: @@ -196,7 +196,7 @@ class LinkSaveIn(SimpleCrypter): for (crypted, jk) in zip(vcrypted, vjk): package_links.extend(self._getLinks(crypted, jk)) except: - self.fail("Unable to decrypt CNL2 links") + self.fail(_("Unable to decrypt CNL2 links")) return package_links -- cgit v1.2.3 From aa0751bcfd995e308bcd586a6965c75e68b1274b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Oct 2014 23:05:13 +0100 Subject: Code cosmetics --- module/plugins/crypter/LinkSaveIn.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index aa340f873..644245e25 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -73,8 +73,6 @@ class LinkSaveIn(SimpleCrypter): # Pack if package_links: self.packages = [(package_name, package_links, folder_name)] - else: - self.fail(_("Could not extract any links")) def isOnline(self): -- cgit v1.2.3 From 885f8ed782e64d9e73367905e642a84d0a8999f1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 04:01:38 +0100 Subject: Update __config__ --- module/plugins/crypter/LinkSaveIn.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 644245e25..6db2e0109 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -19,6 +19,8 @@ class LinkSaveIn(SimpleCrypter): __version__ = "2.02" __pattern__ = r'http://(?:www\.)?linksave\.in/(?P\w+)$' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """LinkSave.in decrypter plugin""" __license__ = "GPLv3" -- 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/crypter/LinkSaveIn.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 6db2e0109..72ce32810 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -14,8 +14,8 @@ from module.unescape import unescape class LinkSaveIn(SimpleCrypter): - __name__ = "LinkSaveIn" - __type__ = "crypter" + __name__ = "LinkSaveIn" + __type__ = "crypter" __version__ = "2.02" __pattern__ = r'http://(?:www\.)?linksave\.in/(?P\w+)$' @@ -23,8 +23,8 @@ class LinkSaveIn(SimpleCrypter): ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """LinkSave.in decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es")] + __license__ = "GPLv3" + __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es")] COOKIES = [(".linksave.in", "Linksave_Language", "english")] -- cgit v1.2.3 From c9e31d875d32de31e54959b82bc35eff2b3e0f3f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 10 Nov 2014 00:19:51 +0100 Subject: Code cosmetics --- module/plugins/crypter/LinkSaveIn.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/LinkSaveIn.py') diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 72ce32810..7015f2ed3 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -155,18 +155,25 @@ class LinkSaveIn(SimpleCrypter): for i, weblink_id in enumerate(ids): try: webLink = "http://linksave.in/%s" % weblink_id + self.logDebug("Decrypting Web link %d, %s" % (i + 1, webLink)) + fwLink = "http://linksave.in/fw-%s" % weblink_id - response = self.load(fwLink) - jscode = re.findall(r'', response)[-1] + res = self.load(fwLink) + + jscode = re.findall(r'', res)[-1] jseval = self.js.eval("document = { write: function(e) { return e; } }; %s" % jscode) dlLink = re.search(r'http://linksave\.in/dl-\w+', jseval).group(0) self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink) - response = self.load(dlLink) - link = unescape(re.search(r'