From cb7bb3881a76e85110868643be04d200113d88f2 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 18 Sep 2011 19:04:05 +0200 Subject: plugin pack by zoidberg --- module/plugins/crypter/MultiloadCz.py | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 module/plugins/crypter/MultiloadCz.py (limited to 'module/plugins/crypter/MultiloadCz.py') diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py new file mode 100644 index 000000000..f34bb3483 --- /dev/null +++ b/module/plugins/crypter/MultiloadCz.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- + +import re +from module.plugins.Crypter import Crypter + +class MultiloadCz(Crypter): + __name__ = "MultiloadCz" + __type__ = "crypter" + __pattern__ = r"http://.*multiload.cz/(stahnout|slozka)/.*" + __version__ = "0.2b" + __description__ = """multiload.cz""" + __config__ = [ + ("usedHoster", "str", "Prefered hoster list (bar-separated) ", "rapidshare.com|uloz.to|quickshare.cz")] + __author_name__ = ("zoidberg") + + # LINK_PATTERN = r'

[^<]*

' + FOLDER_PATTERN = r'

]*>([^>]*)' + + def decrypt(self, pyfile): + self.html = self.load(self.pyfile.url, decode=True) + new_links = [] + + if re.search(self.__pattern__, self.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()) + else: + link_pattern = re.compile(r'

(' + + self.getConfig("usedHoster") + + r')

') + + for found in re.finditer(link_pattern, self.html): + self.logDebug("ML URL:" + found.group(2)) + new_links.append(found.group(2)) + + if new_links: + self.core.files.addLinks(new_links, self.pyfile.package().id) + #self.packages.append((self.pyfile.package().name, new_links, self.pyfile.package().name)) + else: + self.fail('Could not extract any links') + \ No newline at end of file -- cgit v1.2.3