From 8831b9b27bcfadbefa35d133fad3e618d6e30a6e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 20 Oct 2014 02:22:34 +0200 Subject: [Ftp] Improve __pattern__ --- module/plugins/hoster/Ftp.py | 7 ++++--- 1 file 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 -- cgit v1.2.3