diff options
Diffstat (limited to 'pyload/plugins/crypter/OronComFolder.py')
-rwxr-xr-x | pyload/plugins/crypter/OronComFolder.py | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/pyload/plugins/crypter/OronComFolder.py b/pyload/plugins/crypter/OronComFolder.py index 726371966..f6637033b 100755 --- a/pyload/plugins/crypter/OronComFolder.py +++ b/pyload/plugins/crypter/OronComFolder.py @@ -1,46 +1,34 @@ # -*- coding: utf-8 -*- -import re +import re from module.plugins.Crypter import Crypter + class OronComFolder(Crypter): __name__ = "OronComFolder" __type__ = "crypter" __pattern__ = r"http://(?:www\.)?oron.com/folder/\w+" - __version__ = "0.2" + __version__ = "0.1" __description__ = """Oron.com Folder Plugin""" __author_name__ = ("DHMH") __author_mail__ = ("webmaster@pcProfil.de") - FOLDER_PATTERN = r'<table(?:.*)class="tbl"(?:.*)>(?:.*)<table(?:.*)class="tbl2"(?:.*)>(?P<body>.*)</table>(?:.*)</table>' + FOLDER_PATTERN = r'<table width="100%" cellpadding="7" cellspacing="1" class="tbl2">(.*)</table>\n </div>' LINK_PATTERN = r'<a href="([^"]+)" target="_blank">' - def decryptURL(self, url): - html = self.load(url) + def decrypt(self, pyfile): + html = self.load(self.pyfile.url) new_links = [] - if 'No such folder exist' in html: - # Don't fail because if there's more than a folder for this package - # and only one of them fails, no urls at all will be added. - self.logWarning("Folder does not exist") - return new_links - folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL) if folder is None: - # Don't fail because if there's more than a folder for this package - # and only one of them fails, no urls at all will be added. - self.logWarning("Parse error (FOLDER)") - return new_links - + self.fail("Parse error (FOLDER)") + new_links.extend(re.findall(self.LINK_PATTERN, folder.group(0))) - + if new_links: - self.logDebug("Found %d new links" % len(new_links)) - return new_links + self.core.files.addLinks(new_links, self.pyfile.package().id) else: - # Don't fail because if there's more than a folder for this package - # and only one of them fails, no urls at all will be added. - self.logWarning('Could not extract any links') - return new_links + self.fail('Could not extract any links')
\ No newline at end of file |