summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/OronComFolder.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-18 17:59:50 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-18 17:59:50 +0200
commit6130a2377ca6754fee88773097ce220abef1aa47 (patch)
tree76bea0d76393100fcf393c164c96d34f286aba7a /module/plugins/crypter/OronComFolder.py
parentAdded DuckcryptInfo decrypter, smaller fixes (diff)
parentdropdowns in navbar (diff)
downloadpyload-6130a2377ca6754fee88773097ce220abef1aa47.tar.xz
merged stable into default
Diffstat (limited to 'module/plugins/crypter/OronComFolder.py')
-rwxr-xr-xmodule/plugins/crypter/OronComFolder.py28
1 files changed, 21 insertions, 7 deletions
diff --git a/module/plugins/crypter/OronComFolder.py b/module/plugins/crypter/OronComFolder.py
index 57b273163..726371966 100755
--- a/module/plugins/crypter/OronComFolder.py
+++ b/module/plugins/crypter/OronComFolder.py
@@ -8,25 +8,39 @@ class OronComFolder(Crypter):
__name__ = "OronComFolder"
__type__ = "crypter"
__pattern__ = r"http://(?:www\.)?oron.com/folder/\w+"
- __version__ = "0.1"
+ __version__ = "0.2"
__description__ = """Oron.com Folder Plugin"""
__author_name__ = ("DHMH")
__author_mail__ = ("webmaster@pcProfil.de")
- FOLDER_PATTERN = r'<table width="100%" cellpadding="7" cellspacing="1" class="tbl2">(.*)</table>\n </div>'
+ FOLDER_PATTERN = r'<table(?:.*)class="tbl"(?:.*)>(?:.*)<table(?:.*)class="tbl2"(?:.*)>(?P<body>.*)</table>(?:.*)</table>'
LINK_PATTERN = r'<a href="([^"]+)" target="_blank">'
- def decrypt(self, pyfile):
- html = self.load(self.pyfile.url)
+ def decryptURL(self, url):
+ html = self.load(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: self.fail("Parse error (FOLDER)")
+ 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
new_links.extend(re.findall(self.LINK_PATTERN, folder.group(0)))
if new_links:
- self.core.files.addLinks(new_links, self.pyfile.package().id)
+ self.logDebug("Found %d new links" % len(new_links))
+ return new_links
else:
- self.fail('Could not extract any links') \ No newline at end of file
+ # 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