众所周知,aria2的下载线程最高被限制在16,这对于下载普通的文件基本够用了,可是对于百度云的文件来说是远远不够的,我们可以手动修改源码编译,突破线程限制。
环境:Debian 9
apt install -y gcc libgnutls28-dev nettle-dev libssh2-1-dev libc-ares-dev libxml2-dev zlib1g-dev libsqlite3-dev pkg-config libcppunit-dev autoconf automake autotools-dev autopoint libtool git
git clone https://github.com/aria2/aria2.gitvi aria2/src/OptionHandlerFactory.cc
将
OptionHandler* op(new NumberOptionHandler(PREF_MAX_CONNECTION_PER_SERVER, TEXT_MAX_CONNECTION_PER_SERVER, '1', 1, 16, 'x'));
修改为
OptionHandler* op(new NumberOptionHandler(PREF_MAX_CONNECTION_PER_SERVER, TEXT_MAX_CONNECTION_PER_SERVER, '128', 1, -1, 'x'));
将
PREF_MIN_SPLIT_SIZE, TEXT_MIN_SPLIT_SIZE, '20M', 1_m, 1_g, 'k'));
修改为
PREF_MIN_SPLIT_SIZE, TEXT_MIN_SPLIT_SIZE, '4K', 1_k, 1_g, 'k'));
将
PREF_CONNECT_TIMEOUT, TEXT_CONNECT_TIMEOUT, '60', 1, 600));
修改为
PREF_CONNECT_TIMEOUT, TEXT_CONNECT_TIMEOUT, '30', 1, 600));
将
PREF_PIECE_LENGTH, TEXT_PIECE_LENGTH, '1M', 1_m, 1_g));
修改为
PREF_PIECE_LENGTH, TEXT_PIECE_LENGTH, '4k', 1_k, 1_g));
将
new NumberOptionHandler(PREF_RETRY_WAIT, TEXT_RETRY_WAIT, '0', 0, 600));
修改为
new NumberOptionHandler(PREF_RETRY_WAIT, TEXT_RETRY_WAIT, '2', 0, 600));
将
new NumberOptionHandler(PREF_SPLIT, TEXT_SPLIT, '5', 1, -1, 's'));
修改为
new NumberOptionHandler(PREF_SPLIT, TEXT_SPLIT, '8', 1, -1, 's'));
改完后:wq
保存退出
autoreconf -i./configuremake && make install //如果你之前安装了aria2请先卸载
结束,Enjoy!
版权属于:半吊子的静树
本文链接:https://iyoumu.top/archives/22.html
转载时须注明出处及本声明
联系客服