summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Pedro Algarvio <pedro@algarvio.me> 2012-02-05 06:16:16 +0100
committerGravatar Pedro Algarvio <pedro@algarvio.me> 2012-02-05 06:16:16 +0100
commit13c23eb348f9115b2c6b47a579b99d8d1150522b (patch)
tree46fe721820d3fd46745d9c71f48735cd129384a0 /module
parentUpdate Hotfile and Oron Folder crypters to the new `decryptURL` API. (diff)
downloadpyload-13c23eb348f9115b2c6b47a579b99d8d1150522b.tar.xz
Fix OronComFolder regex folder matching.
Diffstat (limited to 'module')
-rwxr-xr-xmodule/plugins/crypter/OronComFolder.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/module/plugins/crypter/OronComFolder.py b/module/plugins/crypter/OronComFolder.py
index 91ac5435f..726371966 100755
--- a/module/plugins/crypter/OronComFolder.py
+++ b/module/plugins/crypter/OronComFolder.py
@@ -13,7 +13,7 @@ class OronComFolder(Crypter):
__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 decryptURL(self, url):
@@ -21,8 +21,18 @@ class OronComFolder(Crypter):
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)))
@@ -30,4 +40,7 @@ class OronComFolder(Crypter):
self.logDebug("Found %d new links" % len(new_links))
return new_links
else:
- self.fail('Could not extract any links')
+ # 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