diff options
Diffstat (limited to 'pyload/plugins/crypter/UploadedToFolder.py')
-rw-r--r-- | pyload/plugins/crypter/UploadedToFolder.py | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/pyload/plugins/crypter/UploadedToFolder.py b/pyload/plugins/crypter/UploadedToFolder.py index 223c419d7..359ba92d0 100644 --- a/pyload/plugins/crypter/UploadedToFolder.py +++ b/pyload/plugins/crypter/UploadedToFolder.py @@ -2,37 +2,33 @@ import re -from pyload.plugins.internal.SimpleCrypter import SimpleCrypter +from urlparse import urljoin + +from module.plugins.internal.SimpleCrypter import SimpleCrypter class UploadedToFolder(SimpleCrypter): - __name__ = "UploadedToFolder" - __type__ = "crypter" - __version__ = "0.4" + __name__ = "UploadedToFolder" + __type__ = "crypter" + __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), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """UploadedTo decrypter plugin""" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] PLAIN_PATTERN = r'<small class="date"><a href="(?P<plain>[\w/]+)" onclick=' - TITLE_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.fail('Parse 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] |