wget下载太慢问题
生活随笔
收集整理的這篇文章主要介紹了
wget下载太慢问题
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
解決辦法
用mwget代替wget,mwget支持多線程下載
git : https://github.com/shengliwang/mwget
m -> multithread
下載mwget
先安裝或更新組件:
sudo apt install build-essential sudo apt upgrade intltool sudo apt install libssl-dev通過(guò)安裝包安裝:
wget http://jaist.dl.sourceforge.net/project/kmphpfm/mwget/0.1/mwget_0.1.0.orig.tar.bz2 tar -xjvf mwget_0.1.0.orig.tar.bz2 cd mwget_0.1.0.orig ./configure sudo make sudo make install出現(xiàn)的問題
ftpplugin.cpp: In member function ‘virtual int FtpPlugin::get_info(Task*)’: ftpplugin.cpp:85:19: error: ‘strlen’ was not declared in this scopeptr = new char[strlen(task->url.get_file()) + 2];^~~~~~ ftpplugin.cpp:85:19: note: suggested alternative: ‘mbrlen’ptr = new char[strlen(task->url.get_file()) + 2];^~~~~~mbrlen ftpplugin.cpp: In member function ‘int FtpPlugin::recursive_get_dir_list(Task&, Ftp*, const char*, const char*, FILE*, FILE*, off_t*)’: ftpplugin.cpp:219:14: error: ‘strlen’ was not declared in this scopecurrdir[strlen(currdir) - 1] = '\0';^~~~~~ ftpplugin.cpp:219:14: note: suggested alternative: ‘mbrlen’currdir[strlen(currdir) - 1] = '\0';^~~~~~mbrlen ftpplugin.cpp:256:7: error: ‘strcmp’ was not declared in this scopeif(strcmp(ptr, ".") == 0 || strcmp(ptr, "..") == 0) continue;^~~~~~ ftpplugin.cpp:256:7: note: suggested alternative: ‘StrDup’if(strcmp(ptr, ".") == 0 || strcmp(ptr, "..") == 0) continue;^~~~~~StrDup有好幾個(gè)文件都報(bào)了這個(gè)錯(cuò),在對(duì)應(yīng)的.cpp中添加
#include <string.h>可以解決。
* 后來(lái)發(fā)現(xiàn)這些報(bào)錯(cuò)的.cpp 都include了utils.h,所以也可以只在utils.h 中添加 #include <string.h>
使用方法
mwget [URL]查看使用方式:
mwget -heg,修改線程數(shù):
mwget -n 16 [URL] #16線程下載(默認(rèn)為4)總結(jié)
以上是生活随笔為你收集整理的wget下载太慢问题的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: qq音乐主页 思路解析(及代码)
- 下一篇: 人工势场法matlab讲解,传统人工势场