diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-01-17 19:12:07 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-01-17 19:12:07 +0100 |
commit | 7008f837ab788e6e0dafba75cb477c8f7c398d01 (patch) | |
tree | 45bced15d602081fe5c0d6f44c8796fbe85e7022 /module/plugins/crypter/LetitbitNetFolder.py | |
parent | Added LONG_WAIT_PATTERN regex (diff) | |
parent | Merged in z00nx0/pyload/CatShareNet (pull request #46: Added CatShareNet plugin) (diff) | |
download | pyload-7008f837ab788e6e0dafba75cb477c8f7c398d01.tar.xz |
Merged in z00nx0/pyload/IFileWs (pull request #51: Added IFileWs plugin)
Diffstat (limited to 'module/plugins/crypter/LetitbitNetFolder.py')
-rw-r--r-- | module/plugins/crypter/LetitbitNetFolder.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/module/plugins/crypter/LetitbitNetFolder.py b/module/plugins/crypter/LetitbitNetFolder.py new file mode 100644 index 000000000..68aad9dd7 --- /dev/null +++ b/module/plugins/crypter/LetitbitNetFolder.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +import re +from module.plugins.Crypter import Crypter + + +class LetitbitNetFolder(Crypter): + __name__ = "LetitbitNetFolder" + __type__ = "crypter" + __pattern__ = r"http://(?:www\.)?letitbit.net/folder/\w+" + __version__ = "0.1" + __description__ = """Letitbit.net Folder Plugin""" + __author_name__ = ("DHMH", "z00nx") + __author_mail__ = ("webmaster@pcProfil.de", "z00nx0@gmail.com") + + FOLDER_PATTERN = r'<table>(.*)</table>' + LINK_PATTERN = r'<a href="([^"]+)" target="_blank">' + + def decrypt(self, pyfile): + html = self.load(self.pyfile.url) + + new_links = [] + + folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + if folder is None: + self.fail("Parse error (FOLDER)") + + new_links.extend(re.findall(self.LINK_PATTERN, folder.group(0))) + + if new_links: + self.core.files.addLinks(new_links, self.pyfile.package().id) + else: + self.fail('Could not extract any links') |