From 02e6b873ad9971d4974a5b4f7a126dee3da60d2c Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 7 Mar 2013 20:17:29 +0100 Subject: SpeedLoadOrgFolder: crypter rewritten Trivial changes to the SimpleCrypter class --- module/plugins/internal/SimpleCrypter.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'module/plugins/internal/SimpleCrypter.py') diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 69798bc0a..b4f4230a1 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -17,12 +17,12 @@ @author: zoidberg """ -from re import findall +import re from module.plugins.Crypter import Crypter class SimpleCrypter(Crypter): __name__ = "SimpleCrypter" - __version__ = "0.01" + __version__ = "0.02" __pattern__ = None __type__ = "crypter" __description__ = """Base crypter plugin""" @@ -35,10 +35,9 @@ class SimpleCrypter(Crypter): def decrypt(self, pyfile): self.html = self.load(self.url) - new_links = [] - new_links.extend(findall(self.LINK_PATTERN, self.html)) + new_links = re.findall(self.LINK_PATTERN, self.html) if new_links: self.core.files.addLinks(new_links, self.pyfile.package().id) else: - self.fail('Could not extract any links') \ No newline at end of file + self.fail('Could not extract any links') -- cgit v1.2.3 From 37a51ca5616b019737280c915ae2729d40f295fc Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 7 Mar 2013 22:07:33 +0100 Subject: SimpleCrypter: improved plugin Added support for package name detection Canonical way to add a package Code cleanup --- module/plugins/internal/SimpleCrypter.py | 44 ++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 11 deletions(-) (limited to 'module/plugins/internal/SimpleCrypter.py') diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index b4f4230a1..b8942c724 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - + @author: zoidberg """ @@ -22,22 +22,44 @@ from module.plugins.Crypter import Crypter class SimpleCrypter(Crypter): __name__ = "SimpleCrypter" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = None __type__ = "crypter" __description__ = """Base crypter plugin""" - __author_name__ = ("zoidberg") - __author_mail__ = ("zoidberg@mujmail.cz") + __author_name__ = ("stickell", "zoidberg") + __author_mail__ = ("l.stickell@yahoo.it", "zoidberg@mujmail.cz") + """ + These patterns should be defined by each hoster: + + LINK_PATTERN: group(1) must be a download link + example: