wget下载太慢问题

解决办法

用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

通过安装包安装:

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

出现的问题

ftpplugin.cpp: In member function ‘virtual int FtpPlugin::get_info(Task*)’:
ftpplugin.cpp:85:19: error: ‘strlen’ was not declared in this scope
    ptr = 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 scope
      currdir[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 scope
    if(strcmp(ptr, ".") == 0 || strcmp(ptr, "..") == 0) continue;
       ^~~~~~
ftpplugin.cpp:256:7: note: suggested alternative: ‘StrDup’
    if(strcmp(ptr, ".") == 0 || strcmp(ptr, "..") == 0) continue;
       ^~~~~~
       StrDup

有好几个文件都报了这个错,在对应的.cpp中添加

#include <string.h>

可以解决。

* 后来发现这些报错的.cpp 都include了utils.h,所以也可以只在utils.h 中添加 #include <string.h>

使用方法

mwget [URL]

查看使用方式:

mwget -h

eg,修改线程数:

mwget -n 16 [URL] #16线程下载(默认为4)

  • 2
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值