summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/DataHuFolder.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/DataHuFolder.py
parent[SimpleCrypter] Use getFileInfo (diff)
downloadpyload-ae15749449563f5adaabd250ea62460c18af6498.tar.xz
Update crypters
Diffstat (limited to 'module/plugins/crypter/DataHuFolder.py')
-rw-r--r--module/plugins/crypter/DataHuFolder.py25
1 files changed, 10 insertions, 15 deletions
diff --git a/module/plugins/crypter/DataHuFolder.py b/module/plugins/crypter/DataHuFolder.py
index 39523c05d..0399e686d 100644
--- a/module/plugins/crypter/DataHuFolder.py
+++ b/module/plugins/crypter/DataHuFolder.py
@@ -8,7 +8,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class DataHuFolder(SimpleCrypter):
__name__ = "DataHuFolder"
__type__ = "crypter"
- __version__ = "0.05"
+ __version__ = "0.06"
__pattern__ = r'http://(?:www\.)?data\.hu/dir/\w+'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
@@ -21,25 +21,20 @@ class DataHuFolder(SimpleCrypter):
LINK_PATTERN = r'<a href=\'(http://data\.hu/get/.+)\' target=\'_blank\'>\1</a>'
- NAME_PATTERN = ur'<title>(.+) Let\xf6lt\xe9se</title>'
+ NAME_PATTERN = ur'<title>(?P<N>.+) Let\xf6lt\xe9se</title>'
- def decrypt(self, pyfile):
- self.html = self.load(pyfile.url, decode=True)
+ def prepare(self):
+ super(DataHuFolder, self).prepare()
if u'K\xe9rlek add meg a jelsz\xf3t' in self.html: # Password protected
password = self.getPassword()
- if password is '':
- self.fail(_("No password specified, please set right password on Add package form and retry"))
- self.logDebug("The folder is password protected', 'Using password: " + password)
- self.html = self.load(pyfile.url, post={'mappa_pass': password}, decode=True)
- if u'Hib\xe1s jelsz\xf3' in self.html: # Wrong password
- self.fail(_("Incorrect password, please set right password on Add package form and retry"))
+ if not password:
+ self.fail(_("Password required"))
- package_name, folder_name = self.getPackageNameAndFolder()
+ self.logDebug("The folder is password protected', 'Using password: " + password)
- package_links = re.findall(self.LINK_PATTERN, self.html)
- self.logDebug("Package has %d links" % len(package_links))
+ self.html = self.load(self.pyfile.url, post={'mappa_pass': password}, decode=True)
- if package_links:
- self.packages = [(package_name, package_links, folder_name)]
+ if u'Hib\xe1s jelsz\xf3' in self.html: # Wrong password
+ self.fail(_("Wrong password"))