summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/UploadedToFolder.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-03 12:16:40 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-03 12:16:40 +0100
commitae15749449563f5adaabd250ea62460c18af6498 (patch)
treeec81abb66abc34bc71c9d957f2914eaa03e7bc6c /module/plugins/crypter/UploadedToFolder.py
parent[SimpleCrypter] Use getFileInfo (diff)
downloadpyload-ae15749449563f5adaabd250ea62460c18af6498.tar.xz
Update crypters
Diffstat (limited to 'module/plugins/crypter/UploadedToFolder.py')
-rw-r--r--module/plugins/crypter/UploadedToFolder.py25
1 files changed, 9 insertions, 16 deletions
diff --git a/module/plugins/crypter/UploadedToFolder.py b/module/plugins/crypter/UploadedToFolder.py
index 23e803979..359ba92d0 100644
--- a/module/plugins/crypter/UploadedToFolder.py
+++ b/module/plugins/crypter/UploadedToFolder.py
@@ -2,13 +2,15 @@
import re
+from urlparse import urljoin
+
from module.plugins.internal.SimpleCrypter import SimpleCrypter
class UploadedToFolder(SimpleCrypter):
__name__ = "UploadedToFolder"
__type__ = "crypter"
- __version__ = "0.41"
+ __version__ = "0.42"
__pattern__ = r'http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P<id>\w+)'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
@@ -20,22 +22,13 @@ class UploadedToFolder(SimpleCrypter):
PLAIN_PATTERN = r'<small class="date"><a href="(?P<plain>[\w/]+)" onclick='
- NAME_PATTERN = r'<title>(.+?)<'
-
+ NAME_PATTERN = r'<title>(?P<N>.+?)<'
- def decrypt(self, pyfile):
- self.html = self.load(pyfile.url)
-
- package_name, folder_name = self.getPackageNameAndFolder()
+ def getLinks(self):
m = re.search(self.PLAIN_PATTERN, self.html)
- if m:
- plain_link = 'http://uploaded.net/' + m.group('plain')
- else:
- self.error(_("Unable to find plain url list"))
-
- self.html = self.load(plain_link)
- package_links = self.html.split('\n')[:-1]
- self.logDebug("Package has %d links" % len(package_links))
+ if m is None:
+ self.error(_("PLAIN_PATTERN not found"))
- self.packages = [(package_name, package_links, folder_name)]
+ plain_link = urljoin("http://uploaded.net/", m.group('plain'))
+ return self.load(plain_link).split('\n')[:-1]