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/DuckCryptInfo.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/crypter/DuckCryptInfo.py') diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index f44bac2e9..4cd3ec197 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -32,7 +32,6 @@ class DuckCryptInfo(Crypter): else: self.handleFolder(found) - def handleFolder(self, found): src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(found.group(2))) found = re.match(self.__pattern__, src) -- 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/DuckCryptInfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/DuckCryptInfo.py') diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index 4cd3ec197..bbf6e6b0d 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -49,7 +49,7 @@ class DuckCryptInfo(Crypter): def handleLink(self, url): src = self.load(url) soup = BeautifulSoup(src) - link = soup.find("iframe")["src"] + link = soup.find("iframe")['src'] if not link: self.logDebug('no links found - (Plugin out of date?)') else: -- 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/DuckCryptInfo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/DuckCryptInfo.py') diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index bbf6e6b0d..6f5efdd1b 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -7,15 +7,18 @@ from module.plugins.Crypter import Crypter class DuckCryptInfo(Crypter): __name__ = "DuckCryptInfo" + __version__ = "0.02" __type__ = "crypter" + __pattern__ = r'http://(?:www\.)?duckcrypt.info/(folder|wait|link)/(\w+)/?(\w*)' - __version__ = "0.02" + __description__ = """DuckCrypt.info decrypter plugin""" __author_name__ = "godofdream" __author_mail__ = "soilfiction@gmail.com" TIMER_PATTERN = r'(.*)' + def decrypt(self, pyfile): url = pyfile.url # seems we don't need to wait -- 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/DuckCryptInfo.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/DuckCryptInfo.py') diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index 6f5efdd1b..aa3a6d2a1 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -52,8 +52,6 @@ class DuckCryptInfo(Crypter): def handleLink(self, url): src = self.load(url) soup = BeautifulSoup(src) - link = soup.find("iframe")['src'] - if not link: + self.urls = [soup.find("iframe")["src"]] + if not self.urls: self.logDebug('no links found - (Plugin out of date?)') - else: - self.core.files.addLinks([link], self.pyfile.package().id) -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/crypter/DuckCryptInfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/DuckCryptInfo.py') diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index aa3a6d2a1..8203f0978 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -28,7 +28,7 @@ class DuckCryptInfo(Crypter): # self.logDebug("Sleeping for" % found.group(1)) # self.setWait(int(found.group(1)) ,False) found = re.match(self.__pattern__, url) - if not found: + if found is None: self.fail('Weird error in link') if str(found.group(1)) == "link": self.handleLink(url) -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/crypter/DuckCryptInfo.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'module/plugins/crypter/DuckCryptInfo.py') diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index 8203f0978..7e13a62f0 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -23,28 +23,28 @@ class DuckCryptInfo(Crypter): url = pyfile.url # seems we don't need to wait #src = self.req.load(str(url)) - #found = re.search(self.TIMER_PATTERN, src) - #if found: - # self.logDebug("Sleeping for" % found.group(1)) - # self.setWait(int(found.group(1)) ,False) - found = re.match(self.__pattern__, url) - if found is None: + #m = re.search(self.TIMER_PATTERN, src) + #if m: + # self.logDebug("Sleeping for" % m.group(1)) + # self.setWait(int(m.group(1)) ,False) + m = re.match(self.__pattern__, url) + if m is None: self.fail('Weird error in link') - if str(found.group(1)) == "link": + if str(m.group(1)) == "link": self.handleLink(url) else: - self.handleFolder(found) + self.handleFolder(m) - def handleFolder(self, found): - src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(found.group(2))) - found = re.match(self.__pattern__, src) - self.logDebug("Redirectet to " + str(found.group(0))) - src = self.load(str(found.group(0))) + def handleFolder(self, m): + src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(m.group(2))) + m = re.match(self.__pattern__, src) + self.logDebug("Redirectet to " + str(m.group(0))) + src = self.load(str(m.group(0))) soup = BeautifulSoup(src) cryptlinks = soup.findAll("div", attrs={"class": "folderbox"}) self.logDebug("Redirectet to " + str(cryptlinks)) if not cryptlinks: - self.fail('no links found - (Plugin out of date?)') + self.fail('no links m - (Plugin out of date?)') for clink in cryptlinks: if clink.find("a"): self.handleLink(clink.find("a")['href']) @@ -54,4 +54,4 @@ class DuckCryptInfo(Crypter): soup = BeautifulSoup(src) self.urls = [soup.find("iframe")["src"]] if not self.urls: - self.logDebug('no links found - (Plugin out of date?)') + self.logDebug('no links m - (Plugin out of date?)') -- cgit v1.2.3 From a1495eb2f9502fdf29974458845f928025bedf53 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 26 Jul 2014 02:36:15 +0200 Subject: Prefer single quote for dict key --- module/plugins/crypter/DuckCryptInfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/DuckCryptInfo.py') diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index 7e13a62f0..456c13606 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -52,6 +52,6 @@ class DuckCryptInfo(Crypter): def handleLink(self, url): src = self.load(url) soup = BeautifulSoup(src) - self.urls = [soup.find("iframe")["src"]] + self.urls = [soup.find("iframe")['src']] if not self.urls: self.logDebug('no links m - (Plugin out of date?)') -- 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/DuckCryptInfo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/DuckCryptInfo.py') diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index 456c13606..e7a5a59e9 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -1,14 +1,16 @@ # -*- coding: utf-8 -*- import re + from module.lib.BeautifulSoup import BeautifulSoup + from module.plugins.Crypter import Crypter class DuckCryptInfo(Crypter): __name__ = "DuckCryptInfo" - __version__ = "0.02" __type__ = "crypter" + __version__ = "0.02" __pattern__ = r'http://(?:www\.)?duckcrypt.info/(folder|wait|link)/(\w+)/?(\w*)' -- cgit v1.2.3