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/NetfolderIn.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 28ee3a9dd..286b9366b 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -23,7 +23,7 @@ class NetfolderIn(SimpleCrypter): # Check for password protection if self.isPasswordProtected(): self.html = self.submitPassword() - if self.html is None: + if not self.html: self.fail("Incorrect password, please set right password on Add package form and retry") # Get package name and folder @@ -36,7 +36,6 @@ class NetfolderIn(SimpleCrypter): self.packages = [(package_name, package_links, folder_name)] def isPasswordProtected(self): - if ' Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/crypter/NetfolderIn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 286b9366b..4c7660ab5 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -7,15 +7,18 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class NetfolderIn(SimpleCrypter): __name__ = "NetfolderIn" + __version__ = "0.6" __type__ = "crypter" + __pattern__ = r'http://(?:www\.)?netfolder.in/((?P\w+)/\w+|folder.php\?folder_id=(?P\w+))' - __version__ = "0.6" + __description__ = """NetFolder.in decrypter plugin""" __author_name__ = ("RaNaN", "fragonib") __author_mail__ = ("RaNaN@pyload.org", "fragonib[AT]yahoo[DOT]es") TITLE_PATTERN = r'
Inhalt des Ordners (?P.+)</span></div>' + def decrypt(self, pyfile): # Request package self.html = self.load(pyfile.url) -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> 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/NetfolderIn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 4c7660ab5..1c337391c 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -7,8 +7,8 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class NetfolderIn(SimpleCrypter): __name__ = "NetfolderIn" - __version__ = "0.6" __type__ = "crypter" + __version__ = "0.6" __pattern__ = r'http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>\w+))' @@ -23,7 +23,7 @@ class NetfolderIn(SimpleCrypter): # Request package self.html = self.load(pyfile.url) - # Check for password protection + # Check for password protection if self.isPasswordProtected(): self.html = self.submitPassword() if not self.html: @@ -55,7 +55,7 @@ class NetfolderIn(SimpleCrypter): url = "http://netfolder.in/folder.php?folder_id=" + id password = self.getPassword() - # Submit package password + # Submit package password post = {'password': password, 'save': 'Absenden'} self.logDebug("Submitting password [%s] for protected links with id [%s]" % (password, id)) html = self.load(url, {}, post) -- cgit v1.2.3 From 6f08566dd6c75d76f5cd2c1dc835e0c22838780f Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 6 Oct 2014 14:49:16 +0200 Subject: Update SimpleCrypter based plugins --- module/plugins/crypter/NetfolderIn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 1c337391c..7baffb25e 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class NetfolderIn(SimpleCrypter): __name__ = "NetfolderIn" __type__ = "crypter" - __version__ = "0.6" + __version__ = "0.7" __pattern__ = r'http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>\w+))' @@ -16,7 +16,7 @@ class NetfolderIn(SimpleCrypter): __author_name__ = ("RaNaN", "fragonib") __author_mail__ = ("RaNaN@pyload.org", "fragonib[AT]yahoo[DOT]es") - TITLE_PATTERN = r'<div class="Text">Inhalt des Ordners <span(.*)>(?P<title>.+)</span></div>' + TITLE_PATTERN = r'<div class="Text">Inhalt des Ordners <span.*>(.+)</span></div>' def decrypt(self, pyfile): -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> 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/NetfolderIn.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 7baffb25e..1e60fa583 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -13,8 +13,9 @@ class NetfolderIn(SimpleCrypter): __pattern__ = r'http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>\w+))' __description__ = """NetFolder.in decrypter plugin""" - __author_name__ = ("RaNaN", "fragonib") - __author_mail__ = ("RaNaN@pyload.org", "fragonib[AT]yahoo[DOT]es") + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("fragonib", "fragonib[AT]yahoo[DOT]es")] + TITLE_PATTERN = r'<div class="Text">Inhalt des Ordners <span.*>(.+)</span></div>' -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/crypter/NetfolderIn.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 1e60fa583..72f3ff0b9 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -13,6 +13,7 @@ class NetfolderIn(SimpleCrypter): __pattern__ = r'http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>\w+))' __description__ = """NetFolder.in decrypter plugin""" + __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org"), ("fragonib", "fragonib[AT]yahoo[DOT]es")] -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 2 --- module/plugins/crypter/NetfolderIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 72f3ff0b9..027503bd2 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -10,7 +10,7 @@ class NetfolderIn(SimpleCrypter): __type__ = "crypter" __version__ = "0.7" - __pattern__ = r'http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>\w+))' + __pattern__ = r'http://(?:www\.)?netfolder\.in/((?P<id1>\w+)/\w+|folder\.php\?folder_id=(?P<id2>\w+))' __description__ = """NetFolder.in decrypter plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/crypter/NetfolderIn.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 027503bd2..03c62ba14 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -40,12 +40,14 @@ class NetfolderIn(SimpleCrypter): # Set package self.packages = [(package_name, package_links, folder_name)] + def isPasswordProtected(self): if '<input type="password" name="password"' in self.html: self.logDebug("Links are password protected") return True return False + def submitPassword(self): # Gather data try: @@ -69,6 +71,7 @@ class NetfolderIn(SimpleCrypter): return html + def getLinks(self): links = re.search(r'name="list" value="(.*?)"', self.html).group(1).split(",") self.logDebug("Package has %d links" % len(links)) -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> 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/NetfolderIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 03c62ba14..01774362c 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -29,7 +29,7 @@ class NetfolderIn(SimpleCrypter): if self.isPasswordProtected(): self.html = self.submitPassword() if not self.html: - self.fail("Incorrect password, please set right password on Add package form and retry") + self.fail(_("Incorrect password, please set right password on Add package form and retry")) # Get package name and folder (package_name, folder_name) = self.getPackageNameAndFolder() -- cgit v1.2.3 From 885f8ed782e64d9e73367905e642a84d0a8999f1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 28 Oct 2014 04:01:38 +0100 Subject: Update __config__ --- module/plugins/crypter/NetfolderIn.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 01774362c..25c4d5d19 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -11,6 +11,8 @@ class NetfolderIn(SimpleCrypter): __version__ = "0.7" __pattern__ = r'http://(?:www\.)?netfolder\.in/((?P<id1>\w+)/\w+|folder\.php\?folder_id=(?P<id2>\w+))' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """NetFolder.in decrypter plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/crypter/NetfolderIn.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 25c4d5d19..4309d30a1 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -6,8 +6,8 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class NetfolderIn(SimpleCrypter): - __name__ = "NetfolderIn" - __type__ = "crypter" + __name__ = "NetfolderIn" + __type__ = "crypter" __version__ = "0.7" __pattern__ = r'http://(?:www\.)?netfolder\.in/((?P<id1>\w+)/\w+|folder\.php\?folder_id=(?P<id2>\w+))' @@ -15,9 +15,9 @@ class NetfolderIn(SimpleCrypter): ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """NetFolder.in decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("fragonib", "fragonib[AT]yahoo[DOT]es")] + __license__ = "GPLv3" + __authors__ = [("RaNaN", "RaNaN@pyload.org"), + ("fragonib", "fragonib[AT]yahoo[DOT]es")] TITLE_PATTERN = r'<div class="Text">Inhalt des Ordners <span.*>(.+)</span></div>' -- cgit v1.2.3 From 772e47ef806d18fd209e910be0535bce7c07dc7b Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 2 Nov 2014 22:47:07 +0100 Subject: Update all other plugins --- module/plugins/crypter/NetfolderIn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 4309d30a1..d94b88af1 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class NetfolderIn(SimpleCrypter): __name__ = "NetfolderIn" __type__ = "crypter" - __version__ = "0.7" + __version__ = "0.71" __pattern__ = r'http://(?:www\.)?netfolder\.in/((?P<id1>\w+)/\w+|folder\.php\?folder_id=(?P<id2>\w+))' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -20,7 +20,7 @@ class NetfolderIn(SimpleCrypter): ("fragonib", "fragonib[AT]yahoo[DOT]es")] - TITLE_PATTERN = r'<div class="Text">Inhalt des Ordners <span.*>(.+)</span></div>' + NAME_PATTERN = r'<div class="Text">Inhalt des Ordners <span.*>(.+)</span></div>' def decrypt(self, pyfile): -- cgit v1.2.3 From ae15749449563f5adaabd250ea62460c18af6498 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 3 Nov 2014 12:16:40 +0100 Subject: Update crypters --- module/plugins/crypter/NetfolderIn.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index d94b88af1..a47bd0503 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter class NetfolderIn(SimpleCrypter): __name__ = "NetfolderIn" __type__ = "crypter" - __version__ = "0.71" + __version__ = "0.72" __pattern__ = r'http://(?:www\.)?netfolder\.in/((?P<id1>\w+)/\w+|folder\.php\?folder_id=(?P<id2>\w+))' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -20,12 +20,11 @@ class NetfolderIn(SimpleCrypter): ("fragonib", "fragonib[AT]yahoo[DOT]es")] - NAME_PATTERN = r'<div class="Text">Inhalt des Ordners <span.*>(.+)</span></div>' + NAME_PATTERN = r'<div class="Text">Inhalt des Ordners <span.*>(?P<N>.+)</span></div>' - def decrypt(self, pyfile): - # Request package - self.html = self.load(pyfile.url) + def prepare(self): + super(NetfolderIn, self).prepare() # Check for password protection if self.isPasswordProtected(): @@ -33,15 +32,6 @@ class NetfolderIn(SimpleCrypter): if not self.html: self.fail(_("Incorrect password, please set right password on Add package form and retry")) - # Get package name and folder - (package_name, folder_name) = self.getPackageNameAndFolder() - - # Get package links - package_links = self.getLinks() - - # Set package - self.packages = [(package_name, package_links, folder_name)] - def isPasswordProtected(self): if '<input type="password" name="password"' in self.html: -- cgit v1.2.3 From 0f530be2642c63759cb6156866f1d4ab119760da Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 12 Dec 2014 20:33:34 +0100 Subject: Fix missing create_getInfo --- module/plugins/crypter/NetfolderIn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index a47bd0503..bfdf5cb82 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -2,7 +2,7 @@ import re -from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class NetfolderIn(SimpleCrypter): @@ -68,3 +68,6 @@ class NetfolderIn(SimpleCrypter): links = re.search(r'name="list" value="(.*?)"', self.html).group(1).split(",") self.logDebug("Package has %d links" % len(links)) return links + + +getInfo = create_getInfo(NetfolderIn) -- cgit v1.2.3 From e1d4186c62512d8bb76d35b6f8d1828d8d0aa94e Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 23 Dec 2014 13:26:32 +0100 Subject: [SimpleHoster] Improve multi-hoster feature --- module/plugins/crypter/NetfolderIn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index bfdf5cb82..62dc5c914 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -10,7 +10,7 @@ class NetfolderIn(SimpleCrypter): __type__ = "crypter" __version__ = "0.72" - __pattern__ = r'http://(?:www\.)?netfolder\.in/((?P<id1>\w+)/\w+|folder\.php\?folder_id=(?P<id2>\w+))' + __pattern__ = r'http://(?:www\.)?netfolder\.in/(folder\.php\?folder_id=)?(?P<ID>\w+)(?(1)|/\w+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] @@ -43,8 +43,8 @@ class NetfolderIn(SimpleCrypter): def submitPassword(self): # Gather data try: - m = re.match(self.__pattern__, self.pyfile.url) - id = max(m.group('id1'), m.group('id2')) + m = re.match(self.__pattern__, self.pyfile.url) + id = m.group('ID') except AttributeError: self.logDebug("Unable to get package id from url [%s]" % self.pyfile.url) return -- cgit v1.2.3