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/FourChanOrg.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/FourChanOrg.py') diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py index 010451c46..dc0cdcb6c 100644 --- a/module/plugins/crypter/FourChanOrg.py +++ b/module/plugins/crypter/FourChanOrg.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +# Based on 4chandl by Roland Beermann +# https://gist.github.com/enkore/3492599 import re @@ -6,13 +8,16 @@ from module.plugins.Crypter import Crypter class FourChanOrg(Crypter): - # Based on 4chandl by Roland Beermann - # https://gist.github.com/enkore/3492599 __name__ = "FourChanOrg" - __type__ = "crypter" __version__ = "0.3" + __type__ = "crypter" + __pattern__ = r'http://(?:www\.)?boards\.4chan.org/\w+/res/(\d+)' + __description__ = """4chan.org folder decrypter plugin""" + __author_name__ = None + __author_mail__ = None + def decrypt(self, pyfile): pagehtml = self.load(pyfile.url) -- 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/FourChanOrg.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'module/plugins/crypter/FourChanOrg.py') diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py index dc0cdcb6c..a911c64d6 100644 --- a/module/plugins/crypter/FourChanOrg.py +++ b/module/plugins/crypter/FourChanOrg.py @@ -21,10 +21,5 @@ class FourChanOrg(Crypter): def decrypt(self, pyfile): pagehtml = self.load(pyfile.url) - images = set(re.findall(r'(images\.4chan\.org/[^/]*/src/[^"<]*)', pagehtml)) - urls = [] - for image in images: - urls.append("http://" + image) - - self.core.files.addLinks(urls, pyfile.package().id) + self.urls = ["http://" + image for image in images] -- 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/FourChanOrg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/FourChanOrg.py') diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py index a911c64d6..c497fa799 100644 --- a/module/plugins/crypter/FourChanOrg.py +++ b/module/plugins/crypter/FourChanOrg.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Based on 4chandl by Roland Beermann -# https://gist.github.com/enkore/3492599 +# +# Based on 4chandl by Roland Beermann (https://gist.github.com/enkore/3492599) import re @@ -9,8 +9,8 @@ from module.plugins.Crypter import Crypter class FourChanOrg(Crypter): __name__ = "FourChanOrg" - __version__ = "0.3" __type__ = "crypter" + __version__ = "0.3" __pattern__ = r'http://(?:www\.)?boards\.4chan.org/\w+/res/(\d+)' -- cgit v1.2.3