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/SafelinkingNet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 4a907c28d..cb2617168 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -10,10 +10,10 @@ from module.lib.BeautifulSoup import BeautifulSoup class SafelinkingNet(Crypter): - __name__ = 'SafelinkingNet' - __type__ = 'crypter' + __name__ = "SafelinkingNet" + __type__ = "crypter" __pattern__ = r'https?://(?:www\.)?safelinking.net/([pd])/\w+' - __version__ = '0.1' + __version__ = "0.1" __description__ = """Safelinking.net decrypter plugin""" __author_name__ = "quareevo" __author_mail__ = "quareevo@arcor.de" -- 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/crypter/SafelinkingNet.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index cb2617168..022f3e5ff 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -40,7 +40,7 @@ class SafelinkingNet(Crypter): if "link-password" in self.html: password = pyfile.package().password - postData["link-password"] = password + postData['link-password'] = password if "altcaptcha" in self.html: for _ in xrange(5): @@ -53,8 +53,8 @@ class SafelinkingNet(Crypter): self.fail("Error parsing captcha") challenge, response = captcha.challenge(captchaKey) - postData["adcopy_challenge"] = challenge - postData["adcopy_response"] = response + postData['adcopy_challenge'] = challenge + postData['adcopy_response'] = response self.html = self.load(url, post=postData) if "The password you entered was incorrect" in self.html: @@ -72,9 +72,9 @@ class SafelinkingNet(Crypter): if m: linkDict = json_loads(m.group(1)) for link in linkDict: - if not "http://" in link["full"]: - packageLinks.append("https://safelinking.net/d/" + link["full"]) + if not "http://" in link['full']: + packageLinks.append("https://safelinking.net/d/" + link['full']) else: - packageLinks.append(link["full"]) + packageLinks.append(link['full']) self.core.files.addLinks(packageLinks, pyfile.package().id) -- 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/SafelinkingNet.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 022f3e5ff..55f4c0ff6 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -11,14 +11,17 @@ from module.lib.BeautifulSoup import BeautifulSoup class SafelinkingNet(Crypter): __name__ = "SafelinkingNet" + __version__ = "0.1" __type__ = "crypter" + __pattern__ = r'https?://(?:www\.)?safelinking.net/([pd])/\w+' - __version__ = "0.1" + __description__ = """Safelinking.net decrypter plugin""" __author_name__ = "quareevo" __author_mail__ = "quareevo@arcor.de" - __Solvemedia_pattern__ = "solvemediaApiKey = '([\w\.\-_]+)';" + SOLVEMEDIA_PATTERN = "solvemediaApiKey = '([\w\.\-_]+)';" + def decrypt(self, pyfile): url = pyfile.url @@ -44,7 +47,7 @@ class SafelinkingNet(Crypter): if "altcaptcha" in self.html: for _ in xrange(5): - m = re.search(self.__Solvemedia_pattern__, self.html) + m = re.search(self.SOLVEMEDIA_PATTERN, self.html) if m: captchaKey = m.group(1) captcha = SolveMedia(self) -- cgit v1.2.3 From a1e78f33dc2b0b6777fdcbc415673f3965b25542 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 16 Jul 2014 00:46:26 +0200 Subject: Prefer self.urls and self.packages for adding links --- module/plugins/crypter/SafelinkingNet.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 55f4c0ff6..2687ed2f2 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -30,13 +30,12 @@ class SafelinkingNet(Crypter): self.load(url) m = re.search("^Location: (.+)$", self.req.http.header, re.MULTILINE) if m: - self.core.files.addLinks([m.group(1)], pyfile.package().id) + self.urls = [m.group(1)] else: self.fail("Couldn't find forwarded Link") else: password = "" - packageLinks = [] postData = {"post-protect": "1"} self.html = self.load(url) @@ -76,8 +75,6 @@ class SafelinkingNet(Crypter): linkDict = json_loads(m.group(1)) for link in linkDict: if not "http://" in link['full']: - packageLinks.append("https://safelinking.net/d/" + link['full']) + self.urls.append("https://safelinking.net/d/" + link['full']) else: - packageLinks.append(link['full']) - - self.core.files.addLinks(packageLinks, pyfile.package().id) + self.urls.append(link['full']) -- 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/SafelinkingNet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 2687ed2f2..e0c165705 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -1,18 +1,20 @@ # -*- coding: utf-8 -*- import re + from pycurl import FOLLOWLOCATION +from module.lib.BeautifulSoup import BeautifulSoup + from module.common.json_layer import json_loads from module.plugins.Crypter import Crypter from module.plugins.internal.CaptchaService import SolveMedia -from module.lib.BeautifulSoup import BeautifulSoup class SafelinkingNet(Crypter): __name__ = "SafelinkingNet" - __version__ = "0.1" __type__ = "crypter" + __version__ = "0.1" __pattern__ = r'https?://(?:www\.)?safelinking.net/([pd])/\w+' -- cgit v1.2.3 From a9117257f71984d553811a605150acb5d1b499ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 5 Oct 2014 02:27:07 +0200 Subject: Better import lib header --- module/plugins/crypter/SafelinkingNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index e0c165705..d548bdf89 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -4,7 +4,7 @@ import re from pycurl import FOLLOWLOCATION -from module.lib.BeautifulSoup import BeautifulSoup +from BeautifulSoup import BeautifulSoup from module.common.json_layer import json_loads from module.plugins.Crypter import Crypter -- 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/crypter/SafelinkingNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index d548bdf89..ca21fe907 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -19,8 +19,8 @@ class SafelinkingNet(Crypter): __pattern__ = r'https?://(?:www\.)?safelinking.net/([pd])/\w+' __description__ = """Safelinking.net decrypter plugin""" - __author_name__ = "quareevo" - __author_mail__ = "quareevo@arcor.de" + __authors__ = [("quareevo", "quareevo@arcor.de")] + SOLVEMEDIA_PATTERN = "solvemediaApiKey = '([\w\.\-_]+)';" -- 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/SafelinkingNet.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index ca21fe907..a496812d2 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -19,6 +19,7 @@ class SafelinkingNet(Crypter): __pattern__ = r'https?://(?:www\.)?safelinking.net/([pd])/\w+' __description__ = """Safelinking.net decrypter plugin""" + __license__ = "GPLv3" __authors__ = [("quareevo", "quareevo@arcor.de")] -- 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/crypter/SafelinkingNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index a496812d2..737e4fc10 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -23,7 +23,7 @@ class SafelinkingNet(Crypter): __authors__ = [("quareevo", "quareevo@arcor.de")] - SOLVEMEDIA_PATTERN = "solvemediaApiKey = '([\w\.\-_]+)';" + SOLVEMEDIA_PATTERN = "solvemediaApiKey = '([\w.-]+)';" def decrypt(self, pyfile): -- 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/SafelinkingNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 737e4fc10..33b3d73ab 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -16,7 +16,7 @@ class SafelinkingNet(Crypter): __type__ = "crypter" __version__ = "0.1" - __pattern__ = r'https?://(?:www\.)?safelinking.net/([pd])/\w+' + __pattern__ = r'https?://(?:www\.)?safelinking\.net/([pd])/\w+' __description__ = """Safelinking.net decrypter plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 99fcb5c59bcb95311e0eb2213bcf23943d57769c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 20 Oct 2014 02:10:06 +0200 Subject: [SafelinkingNet] Better way to retrieve password --- module/plugins/crypter/SafelinkingNet.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 33b3d73ab..9ef4529cb 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -38,14 +38,12 @@ class SafelinkingNet(Crypter): self.fail("Couldn't find forwarded Link") else: - password = "" postData = {"post-protect": "1"} self.html = self.load(url) if "link-password" in self.html: - password = pyfile.package().password - postData['link-password'] = password + postData['link-password'] = self.getPassword() if "altcaptcha" in self.html: for _ in xrange(5): -- 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/SafelinkingNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 9ef4529cb..fcc48ca22 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -31,7 +31,7 @@ class SafelinkingNet(Crypter): if re.match(self.__pattern__, url).group(1) == "d": self.req.http.c.setopt(FOLLOWLOCATION, 0) self.load(url) - m = re.search("^Location: (.+)$", self.req.http.header, re.MULTILINE) + m = re.search("^Location: (.+)$", self.req.http.header, re.M) if m: self.urls = [m.group(1)] else: -- cgit v1.2.3 From 1c4bf83881d2a22da3773666a580d51f6b57bfd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 03:07:21 +0200 Subject: Avoid gettext conflict due variable `_` --- module/plugins/crypter/SafelinkingNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index fcc48ca22..d9b511cf5 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -46,7 +46,7 @@ class SafelinkingNet(Crypter): postData['link-password'] = self.getPassword() if "altcaptcha" in self.html: - for _ in xrange(5): + for _i in xrange(5): m = re.search(self.SOLVEMEDIA_PATTERN, self.html) if m: captchaKey = m.group(1) -- 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/SafelinkingNet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index d9b511cf5..fbeaa406c 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -35,7 +35,7 @@ class SafelinkingNet(Crypter): if m: self.urls = [m.group(1)] else: - self.fail("Couldn't find forwarded Link") + self.fail(_("Couldn't find forwarded Link")) else: postData = {"post-protect": "1"} @@ -53,7 +53,7 @@ class SafelinkingNet(Crypter): captcha = SolveMedia(self) captchaProvider = "Solvemedia" else: - self.fail("Error parsing captcha") + self.fail(_("Error parsing captcha")) challenge, response = captcha.challenge(captchaKey) postData['adcopy_challenge'] = challenge @@ -61,7 +61,7 @@ class SafelinkingNet(Crypter): self.html = self.load(url, post=postData) if "The password you entered was incorrect" in self.html: - self.fail("Incorrect Password") + self.fail(_("Incorrect Password")) if not "The CAPTCHA code you entered was wrong" in self.html: break -- 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/SafelinkingNet.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index fbeaa406c..37bb4d37e 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -17,6 +17,8 @@ class SafelinkingNet(Crypter): __version__ = "0.1" __pattern__ = r'https?://(?:www\.)?safelinking\.net/([pd])/\w+' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Safelinking.net 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/SafelinkingNet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 37bb4d37e..1fbb6e137 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -12,8 +12,8 @@ from module.plugins.internal.CaptchaService import SolveMedia class SafelinkingNet(Crypter): - __name__ = "SafelinkingNet" - __type__ = "crypter" + __name__ = "SafelinkingNet" + __type__ = "crypter" __version__ = "0.1" __pattern__ = r'https?://(?:www\.)?safelinking\.net/([pd])/\w+' @@ -21,8 +21,8 @@ class SafelinkingNet(Crypter): ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Safelinking.net decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("quareevo", "quareevo@arcor.de")] + __license__ = "GPLv3" + __authors__ = [("quareevo", "quareevo@arcor.de")] SOLVEMEDIA_PATTERN = "solvemediaApiKey = '([\w.-]+)';" -- cgit v1.2.3 From 58c9c8d78417ec6ccac5b6b117ea540033a09574 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 7 Nov 2014 17:08:21 +0100 Subject: Fix download link formatting in some plugins --- module/plugins/crypter/SafelinkingNet.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 1fbb6e137..9bb6c3229 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -14,7 +14,7 @@ from module.plugins.internal.CaptchaService import SolveMedia class SafelinkingNet(Crypter): __name__ = "SafelinkingNet" __type__ = "crypter" - __version__ = "0.1" + __version__ = "0.11" __pattern__ = r'https?://(?:www\.)?safelinking\.net/([pd])/\w+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -30,20 +30,18 @@ class SafelinkingNet(Crypter): def decrypt(self, pyfile): url = pyfile.url + if re.match(self.__pattern__, url).group(1) == "d": - self.req.http.c.setopt(FOLLOWLOCATION, 0) - self.load(url) - m = re.search("^Location: (.+)$", self.req.http.header, re.M) - if m: - self.urls = [m.group(1)] + + header = self.load(url, just_header=True) + if 'location' in header: + self.urls = [header['location']] else: - self.fail(_("Couldn't find forwarded Link")) + self.error(_("Couldn't find forwarded Link")) else: postData = {"post-protect": "1"} - self.html = self.load(url) - if "link-password" in self.html: postData['link-password'] = self.getPassword() -- cgit v1.2.3 From 4d578cb15f3d6edd036e438e504739b97660f93e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Dec 2014 16:58:35 +0100 Subject: Spare code cosmetics --- module/plugins/crypter/SafelinkingNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/SafelinkingNet.py') diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 9bb6c3229..709083b51 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -57,7 +57,7 @@ class SafelinkingNet(Crypter): challenge, response = captcha.challenge(captchaKey) postData['adcopy_challenge'] = challenge - postData['adcopy_response'] = response + postData['adcopy_response'] = response self.html = self.load(url, post=postData) if "The password you entered was incorrect" in self.html: -- cgit v1.2.3