From 52ba83f29d9221c05434857e79f12c44752a321e Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 28 Dec 2010 22:51:10 +0100 Subject: more fixes and chunk+resume debug --- module/plugins/hoster/Ftp.py | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) (limited to 'module/plugins/hoster/Ftp.py') diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 9303b00c8..ca0689c62 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -14,17 +14,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - @author: jeix + @author: jeix @author: mkaay """ -import logging -from os.path import exists -from os.path import join -from os.path import exists -from os import makedirs -import sys - from module.plugins.Hoster import Hoster @@ -38,21 +31,11 @@ class Ftp(Hoster): __author_mail__ = ("jeix@hasnomail.com", "mkaay@mkaay.de") def process(self, pyfile): - self.req = pyfile.m.core.requestFactory.getRequest(self.__name__, type="FTP") + self.req = pyfile.m.core.requestFactory.getRequest(self.__name__) pyfile.name = self.pyfile.url.rpartition('/')[2] - - self.doDownload(pyfile.url, pyfile.name) - - def doDownload(self, url, filename): - self.pyfile.setStatus("downloading") - - download_folder = self.core.config['general']['download_folder'] - location = join(download_folder, self.pyfile.package().folder.decode(sys.getfilesystemencoding())) - if not exists(location): - makedirs(location) - - newname = self.req.download(str(url), join(location, filename.decode(sys.getfilesystemencoding()))) - self.pyfile.size = self.req.dl_size - - if newname: - self.pyfile.name = newname + + self.chunkLimit = -1 + self.resumeDownload = True + + self.download(pyfile.url) + -- cgit v1.2.3