summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Pedro Algarvio <pedro@algarvio.me> 2012-02-04 19:10:42 +0100
committerGravatar Pedro Algarvio <pedro@algarvio.me> 2012-02-04 19:10:42 +0100
commit5e5e9b92c5aa4d0fc7a558c06f9137c5edc7bbed (patch)
tree8ba5857a4399275c52901c1931b5c08c927211d6 /module
parentAdd helper method `formatTrafficleft()` to `module.plugins.Account`. (diff)
downloadpyload-5e5e9b92c5aa4d0fc7a558c06f9137c5edc7bbed.tar.xz
Update Hotfile and Oron Folder crypters to the new `decryptURL` API.
Diffstat (limited to 'module')
-rw-r--r--module/plugins/crypter/HotfileFolderCom.py18
-rwxr-xr-xmodule/plugins/crypter/OronComFolder.py11
2 files changed, 17 insertions, 12 deletions
diff --git a/module/plugins/crypter/HotfileFolderCom.py b/module/plugins/crypter/HotfileFolderCom.py
index 00771e2a3..ea7311e3c 100644
--- a/module/plugins/crypter/HotfileFolderCom.py
+++ b/module/plugins/crypter/HotfileFolderCom.py
@@ -9,17 +9,21 @@ class HotfileFolderCom(Crypter):
__name__ = "HotfileFolderCom"
__type__ = "crypter"
__pattern__ = r"http://(?:www\.)?hotfile.com/list/\w+/\w+"
- __version__ = "0.1"
+ __version__ = "0.2"
__description__ = """HotfileFolder Download Plugin"""
__author_name__ = ("RaNaN")
__author_mail__ = ("RaNaN@pyload.org")
- def decrypt(self, pyfile):
- html = self.load(pyfile.url)
+ def decryptURL(self, url):
+ html = self.load(url)
- name = re.findall(r'<img src="/i/folder.gif" width="23" height="14" style="margin-bottom: -2px;" />([^<]+)', html, re.MULTILINE)[0].replace("/", "")
- new_links = re.findall(r'href="(http://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+[^"]+)', html)
+ new_links = []
+ for link in re.findall(r'href="(http://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+[^"]+)', html):
+ new_links.append(link[0])
- new_links = [x[0] for x in new_links]
+ if new_links:
+ self.logDebug("Found %d new links" % len(new_links))
+ return new_links
+ else:
+ self.fail('Could not extract any links')
- self.packages.append((name, new_links, name)) \ No newline at end of file
diff --git a/module/plugins/crypter/OronComFolder.py b/module/plugins/crypter/OronComFolder.py
index 57b273163..91ac5435f 100755
--- a/module/plugins/crypter/OronComFolder.py
+++ b/module/plugins/crypter/OronComFolder.py
@@ -8,7 +8,7 @@ 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")
@@ -16,8 +16,8 @@ class OronComFolder(Crypter):
FOLDER_PATTERN = r'<table width="100%" cellpadding="7" cellspacing="1" class="tbl2">(.*)</table>\n </div>'
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 = []
@@ -27,6 +27,7 @@ class OronComFolder(Crypter):
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
+ self.fail('Could not extract any links')