summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/Ftp.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-18 19:14:29 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-18 19:14:29 +0200
commit9d9618ab35071f36840fe51e63fe2f887131dc5a (patch)
tree47028e89e5a7a2ede5e1d0eddfa7930ba367baf6 /module/plugins/hoster/Ftp.py
parent[SimpleCrypter] Don't use self.link(s) (diff)
downloadpyload-9d9618ab35071f36840fe51e63fe2f887131dc5a.tar.xz
Update hosters
Diffstat (limited to 'module/plugins/hoster/Ftp.py')
-rw-r--r--module/plugins/hoster/Ftp.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py
index c30ad3c37..fc975329b 100644
--- a/module/plugins/hoster/Ftp.py
+++ b/module/plugins/hoster/Ftp.py
@@ -2,10 +2,9 @@
import pycurl
import re
-import urllib
import urlparse
-from module.plugins.internal.Hoster import Hoster
+from module.plugins.internal.Hoster import Hoster, parse_name
class Ftp(Hoster):
@@ -25,20 +24,15 @@ class Ftp(Hoster):
def setup(self):
- self.chunk_limit = -1
+ self.chunk_limit = -1
self.resume_download = True
def process(self, pyfile):
- p_url = urlparse.urlparse(pyfile.url)
+ p_url = urlparse.urlparse(pyfile.url)
netloc = p_url.netloc
- pyfile.name = p_url.path.rpartition('/')[2]
- try:
- pyfile.name = urllib.unquote(str(pyfile.name)).decode('utf8')
-
- except Exception:
- pass
+ pyfile.name = parse_name(p_url.path.rpartition('/')[2])
if not "@" in netloc:
self.log_debug("Auth required")
@@ -74,6 +68,7 @@ class Ftp(Hoster):
m = re.search(r"Content-Length:\s*(\d+)", res)
if m is not None:
pyfile.size = int(m.group(1))
+
self.download(pyfile.url)
else: