summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-12-28 22:51:10 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-12-28 22:51:10 +0100
commit52ba83f29d9221c05434857e79f12c44752a321e (patch)
tree42369d33d8b0116524e26c429c649ec40cec516a /module/plugins/hoster
parentworking speedlimit + proxy support, closed #197 (diff)
downloadpyload-52ba83f29d9221c05434857e79f12c44752a321e.tar.xz
more fixes and chunk+resume debug
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/Ftp.py33
1 files changed, 8 insertions, 25 deletions
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 <http://www.gnu.org/licenses/>.
- @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)
+