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/CzshareComFolder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index d1ba8335c..c3606fdab 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -22,7 +22,8 @@ class CzshareComFolder(Crypter): new_links = [] found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: self.fail("Parse error (FOLDER)") + if not found: + self.fail("Parse error (FOLDER)") new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) if new_links: -- 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/CzshareComFolder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index c3606fdab..c60d5a87d 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -6,9 +6,11 @@ from module.plugins.Crypter import Crypter class CzshareComFolder(Crypter): __name__ = "CzshareComFolder" + __version__ = "0.2" __type__ = "crypter" + __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' - __version__ = "0.2" + __description__ = """Czshare.com folder decrypter plugin, now Sdilej.cz""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -17,6 +19,7 @@ class CzshareComFolder(Crypter): LINK_PATTERN = r'info' #NEXT_PAGE_PATTERN = r'' + def decrypt(self, pyfile): html = 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/CzshareComFolder.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index c60d5a87d..e0c311ba8 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -17,19 +17,15 @@ class CzshareComFolder(Crypter): FOLDER_PATTERN = r'\s*\s*(.*?)
' LINK_PATTERN = r'info' - #NEXT_PAGE_PATTERN = r'' def decrypt(self, pyfile): html = self.load(pyfile.url) - new_links = [] found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) if not found: self.fail("Parse error (FOLDER)") - new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) - if new_links: - self.core.files.addLinks(new_links, pyfile.package().id) - else: + self.urls.extend(re.findall(self.LINK_PATTERN, found.group(1))) + if not self.urls: self.fail('Could not extract any links') -- 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/CzshareComFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index e0c311ba8..76762b69b 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -23,7 +23,7 @@ class CzshareComFolder(Crypter): html = self.load(pyfile.url) found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if not found: + if found is None: self.fail("Parse error (FOLDER)") self.urls.extend(re.findall(self.LINK_PATTERN, found.group(1))) -- 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/CzshareComFolder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 76762b69b..b305575a2 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -22,10 +22,10 @@ class CzshareComFolder(Crypter): def decrypt(self, pyfile): html = self.load(pyfile.url) - found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: + m = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + if m is None: self.fail("Parse error (FOLDER)") - self.urls.extend(re.findall(self.LINK_PATTERN, found.group(1))) + self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1))) if not self.urls: self.fail('Could not extract any links') -- 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/CzshareComFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/CzshareComFolder.py') diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index b305575a2..64affc867 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -6,8 +6,8 @@ from module.plugins.Crypter import Crypter class CzshareComFolder(Crypter): __name__ = "CzshareComFolder" - __version__ = "0.2" __type__ = "crypter" + __version__ = "0.2" __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' -- cgit v1.2.3