diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-01-14 18:42:56 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-01-14 18:42:56 +0100 |
commit | 616c5d0e2357aeb985435e9ef0c1ead1b4feaf11 (patch) | |
tree | f612e856aeabb1f255230c5347dad275ef1f8aa4 /module/plugins/crypter | |
parent | Fixed offline regex (diff) | |
parent | Merged in z00nx0/pyload/SecureUploadEu (pull request #47: Added SecureUploadE... (diff) | |
download | pyload-616c5d0e2357aeb985435e9ef0c1ead1b4feaf11.tar.xz |
Merged in z00nx0/pyload/CatShareNet (pull request #46: Added CatShareNet plugin)
Diffstat (limited to 'module/plugins/crypter')
-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') |