summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/Ftp.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/Ftp.py')
-rw-r--r--module/plugins/hoster/Ftp.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py
index 5be380078..5258a1c27 100644
--- a/module/plugins/hoster/Ftp.py
+++ b/module/plugins/hoster/Ftp.py
@@ -2,9 +2,8 @@
import pycurl
import re
-
-from urllib import quote, unquote
-from urlparse import urlparse
+import urllib
+import urlparse
from module.plugins.Hoster import Hoster
@@ -29,12 +28,12 @@ class Ftp(Hoster):
def process(self, pyfile):
- parsed_url = urlparse(pyfile.url)
+ parsed_url = urlparse.urlparse(pyfile.url)
netloc = parsed_url.netloc
pyfile.name = parsed_url.path.rpartition('/')[2]
try:
- pyfile.name = unquote(str(pyfile.name)).decode('utf8')
+ pyfile.name = urllib.unquote(str(pyfile.name)).decode('utf8')
except Exception:
pass
@@ -67,11 +66,11 @@ class Ftp(Hoster):
#Naive ftp directory listing
if re.search(r'^25\d.*?"', self.req.http.header, re.M):
pyfile.url = pyfile.url.rstrip('/')
- pkgname = "/".join(pyfile.package().name, urlparse(pyfile.url).path.rpartition('/')[2])
+ pkgname = "/".join(pyfile.package().name, urlparse.urlparse(pyfile.url).path.rpartition('/')[2])
pyfile.url += '/'
self.req.http.c.setopt(48, 1) # CURLOPT_DIRLISTONLY
res = self.load(pyfile.url, decode=False)
- links = [pyfile.url + quote(x) for x in res.splitlines()]
+ links = [pyfile.url + urllib.quote(x) for x in res.splitlines()]
self.logDebug("LINKS", links)
self.core.api.addPackage(pkgname, links)
else: