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/UlozToFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/UlozToFolder.py') diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index eebb14497..6c7729fee 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -24,7 +24,7 @@ class UlozToFolder(Crypter): for i in xrange(1, 100): self.logInfo("Fetching links from page %i" % i) found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: + if not found: self.fail("Parse error (FOLDER)") new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) -- 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/UlozToFolder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/UlozToFolder.py') diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index 6c7729fee..6ba4b0819 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -6,9 +6,11 @@ from module.plugins.Crypter import Crypter class UlozToFolder(Crypter): __name__ = "UlozToFolder" + __version__ = "0.2" __type__ = "crypter" + __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(m|soubory)/.*' - __version__ = "0.2" + __description__ = """Uloz.to folder decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" @@ -17,6 +19,7 @@ class UlozToFolder(Crypter): LINK_PATTERN = r'
[^<]+' 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/UlozToFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/UlozToFolder.py') diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index 6ba4b0819..f9ddd3c84 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -40,6 +40,6 @@ class UlozToFolder(Crypter): self.logInfo("Limit of 99 pages reached, aborting") if new_links: - self.core.files.addLinks(map(lambda s: "http://ulozto.net/%s" % s, new_links), pyfile.package().id) + self.urls = [map(lambda s: "http://ulozto.net/%s" % s, new_links)] else: 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/UlozToFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/UlozToFolder.py') diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index f9ddd3c84..43dbb4807 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -27,7 +27,7 @@ class UlozToFolder(Crypter): for i in xrange(1, 100): self.logInfo("Fetching links from page %i" % i) found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if not found: + if found is None: self.fail("Parse error (FOLDER)") new_links.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/UlozToFolder.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/crypter/UlozToFolder.py') diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index 43dbb4807..dfa1bb8c4 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -26,14 +26,14 @@ class UlozToFolder(Crypter): new_links = [] for i in xrange(1, 100): self.logInfo("Fetching links from page %i" % i) - 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)") - new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) - found = re.search(self.NEXT_PAGE_PATTERN, html) - if found: - html = self.load("http://ulozto.net/" + found.group(1)) + new_links.extend(re.findall(self.LINK_PATTERN, m.group(1))) + m = re.search(self.NEXT_PAGE_PATTERN, html) + if m: + html = self.load("http://ulozto.net/" + m.group(1)) else: break else: -- 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/UlozToFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/UlozToFolder.py') diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index dfa1bb8c4..06d30099c 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -6,8 +6,8 @@ from module.plugins.Crypter import Crypter class UlozToFolder(Crypter): __name__ = "UlozToFolder" - __version__ = "0.2" __type__ = "crypter" + __version__ = "0.2" __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(m|soubory)/.*' -- cgit v1.2.3