diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-20 02:22:34 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-20 02:22:34 +0200 |
commit | 8831b9b27bcfadbefa35d133fad3e618d6e30a6e (patch) | |
tree | 55b2137344221d71998ebb6f296b7f394d9cff87 /module/plugins/hoster | |
parent | [SafelinkingNet] Better way to retrieve password (diff) | |
download | pyload-8831b9b27bcfadbefa35d133fad3e618d6e30a6e.tar.xz |
[Ftp] Improve __pattern__
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/Ftp.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index f80fdd69f..bdf75b10f 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -12,9 +12,9 @@ from module.plugins.Hoster import Hoster class Ftp(Hoster): __name__ = "Ftp" __type__ = "hoster" - __version__ = "0.42" + __version__ = "0.43" - __pattern__ = r'(ftps?|sftp)://(.*?:.*?@)?.*?/.*' # ftp://user:password@ftp\.server\.org/path/to/file + __pattern__ = r'(?:ftps?|sftp)://([\w.-]+(:[\w.-]+)?@)?[\w.-]+(:\d+)?/.+' __description__ = """Download from ftp directory""" __license__ = "GPLv3" @@ -27,6 +27,7 @@ class Ftp(Hoster): self.chunkLimit = -1 self.resumeDownload = True + def process(self, pyfile): parsed_url = urlparse(pyfile.url) netloc = parsed_url.netloc @@ -44,7 +45,7 @@ class Ftp(Hoster): self.logDebug("Logging on to %s" % netloc) self.req.addAuth(self.account.accounts[netloc]['password']) else: - for pwd in pyfile.package().password.splitlines(): + for pwd in self.getPassword().splitlines(): if ":" in pwd: self.req.addAuth(pwd.strip()) break |