diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-09-08 00:29:57 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-09-14 11:02:23 +0200 |
commit | 68d662e689cd42687341c550fb6ebb74e6968d21 (patch) | |
tree | 486cef41bd928b8db704894233b2cef94a6e346f /pyload/plugins/crypter/MultiloadCz.py | |
parent | save_join -> safe_join & save_path -> safe_filename (diff) | |
download | pyload-68d662e689cd42687341c550fb6ebb74e6968d21.tar.xz |
module -> pyload
Diffstat (limited to 'pyload/plugins/crypter/MultiloadCz.py')
-rw-r--r-- | pyload/plugins/crypter/MultiloadCz.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/pyload/plugins/crypter/MultiloadCz.py b/pyload/plugins/crypter/MultiloadCz.py new file mode 100644 index 000000000..be7950e98 --- /dev/null +++ b/pyload/plugins/crypter/MultiloadCz.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- + +import re +from pyload.plugins.Crypter import Crypter + + +class MultiloadCz(Crypter): + __name__ = "MultiloadCz" + __type__ = "crypter" + __version__ = "0.4" + + __pattern__ = r'http://(?:[^/]*\.)?multiload.cz/(stahnout|slozka)/.*' + __config__ = [("usedHoster", "str", "Prefered hoster list (bar-separated) ", ""), + ("ignoredHoster", "str", "Ignored hoster list (bar-separated) ", "")] + + __description__ = """Multiload.cz decrypter plugin""" + __author_name__ = "zoidberg" + __author_mail__ = "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) + + if re.match(self.__pattern__, pyfile.url).group(1) == "slozka": + m = re.search(self.FOLDER_PATTERN, self.html) + if m: + self.urls.extend(m.group(1).split()) + else: + m = re.findall(self.LINK_PATTERN, self.html) + if m: + prefered_set = set(self.getConfig("usedHoster").split('|')) + self.urls.extend([x[1] for x in m if x[0] in prefered_set]) + + if not self.urls: + ignored_set = set(self.getConfig("ignoredHoster").split('|')) + self.urls.extend([x[1] for x in m if x[0] not in ignored_set]) + + if not self.urls: + self.fail('Could not extract any links') |