diff options
Diffstat (limited to 'module/plugins/crypter/MultiloadCz.py')
-rw-r--r-- | module/plugins/crypter/MultiloadCz.py | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py index 5e7051bad..fa1eb02d7 100644 --- a/module/plugins/crypter/MultiloadCz.py +++ b/module/plugins/crypter/MultiloadCz.py @@ -5,38 +5,38 @@ from module.plugins.Crypter import Crypter class MultiloadCz(Crypter): - __name__ = "MultiloadCz" - __type__ = "crypter" - __pattern__ = r'http://(?:[^/]*\.)?multiload.cz/(stahnout|slozka)/.*' - __version__ = "0.4" + __name__ = "MultiloadCz" + __type__ = "crypter" + __version__ = "0.40" + + __pattern__ = r'http://(?:[^/]*\.)?multiload\.cz/(stahnout|slozka)/.+' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True), + ("usedHoster", "str", "Prefered hoster list (bar-separated)", ""), + ("ignoredHoster", "str", "Ignored hoster list (bar-separated)", "")] + __description__ = """Multiload.cz decrypter plugin""" - __config__ = [("usedHoster", "str", "Prefered hoster list (bar-separated) ", ""), - ("ignoredHoster", "str", "Ignored hoster list (bar-separated) ", "")] - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + FOLDER_PATTERN = r'<form action="" method="get"><textarea[^>]*>([^>]*)</textarea></form>' LINK_PATTERN = r'<p class="manager-server"><strong>([^<]+)</strong></p><p class="manager-linky"><a href="([^"]+)">' + def decrypt(self, pyfile): self.html = self.load(pyfile.url, decode=True) - new_links = [] if re.match(self.__pattern__, pyfile.url).group(1) == "slozka": - found = re.search(self.FOLDER_PATTERN, self.html) - if found is not None: - new_links.extend(found.group(1).split()) + m = re.search(self.FOLDER_PATTERN, self.html) + if m: + self.urls.extend(m.group(1).split()) else: - found = re.findall(self.LINK_PATTERN, self.html) - if found: + m = re.findall(self.LINK_PATTERN, self.html) + if m: prefered_set = set(self.getConfig("usedHoster").split('|')) - new_links.extend([x[1] for x in found if x[0] in prefered_set]) + self.urls.extend([x[1] for x in m if x[0] in prefered_set]) - if not new_links: + if not self.urls: ignored_set = set(self.getConfig("ignoredHoster").split('|')) - new_links.extend([x[1] for x in found if x[0] not in ignored_set]) - - if new_links: - self.core.files.addLinks(new_links, pyfile.package().id) - else: - self.fail('Could not extract any links') + self.urls.extend([x[1] for x in m if x[0] not in ignored_set]) |