使用aria2c代替wget或curl,使用Debian替代子系统下载大型文件,而不是更改shell脚本。
aria2stub的Python项目详细描述
wget curl的aria2c
wget和curl的存根让aria2c使用Debian替代子系统下载大文件,而不是更改shell脚本。 与wget/curl相比,aria2c更好,因为它试图利用您的最大下载带宽。 因为将shell脚本从wget/curl更改为等效的aria2c cli需要时间,所以这个存根将wget/curl命令转换为等效的aria2c命令并执行它。 如果无法执行,则执行原始命令。在
安装说明
- 安装aria2c
- 安装wget和(或)curl
Wget
- 将原始wget复制到wget orig
$ sudo cp /usr/bin/wget /usr/bin/wget-orig
- 安装aria2stub包。在
现在,wget
命令作为当前用户的默认值运行存根。在
(以下步骤可选)默认情况下,让所有用户执行存根。
- 将安装的二进制文件(默认值为/usr/local/bin/)移到/usr/bin/。在
$ sudo mv /usr/local/bin/wget /usr/bin/wget-stub
- 使用更新替代设置默认二进制文件。在
$ sudo update-alternatives --install /usr/bin/wget wget /usr/bin/wget-orig 30update-alternatives: using /usr/bin/wget-orig to provide /usr/bin/wget (wget) in auto mode$ sudo update-alternatives --install /usr/bin/wget wget /usr/bin/wget-stub 40update-alternatives: using /usr/bin/wget-stub to provide /usr/bin/wget (wget) in auto mode
- 验证wget stub是否为默认值
$ sudo update-alternatives --config wget There are 2 choices for the alternative wget (providing /usr/bin/wget). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/wget-stub 40 auto mode 1 /usr/bin/wget-orig 30 manual mode 2 /usr/bin/wget-stub 40 manual modePress <enter> to keep the current choice[*], or type selection number:
- 设置就绪,请立即尝试使用wget。在
卷曲
- 将原始卷曲复制到curl orig
$ sudo cp /usr/bin/curl /usr/bin/curl-orig
- 安装aria2stub包。在
现在,curl
命令作为当前用户的默认值运行存根。在
(以下步骤是可选的)默认情况下让所有用户执行存根。
- 将安装的二进制文件(默认值为/usr/local/bin/)移到/usr/bin/。在
$ sudo cp /usr/local/bin/curl /usr/bin/curl-stub
- 使用更新替代设置默认二进制
$ sudo update-alternatives --install /usr/bin/curl curl /usr/bin/curl-orig 30update-alternatives: using /usr/bin/curl-orig to provide /usr/bin/curl (curl) in auto mode$ sudo update-alternatives --install /usr/bin/curl curl /usr/bin/curl-stub 40update-alternatives: using /usr/bin/curl-stub to provide /usr/bin/curl (curl) in auto mode
- 验证curl stub是否为默认值
$ sudo update-alternatives --config curl There are 2 choices for the alternative curl (providing /usr/bin/curl). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/curl-stub 40 auto mode 1 /usr/bin/curl-orig 30 manual mode 2 /usr/bin/curl-stub 40 manual modePress <enter> to keep the current choice[*], or type selection number:
- 设置就绪,请立即尝试使用curl。在
注意
- 如果命令不能转换为aria2c等效命令,那么它将返回到相应的程序。在
- 使用--orig标志使用原始程序。在
- .curlrc目前不受支持
- 要恢复到使用原始命令(如果遵循可选方法),请对wget运行以下命令(类似于curl):
$ sudo update-alternatives --config wget
卷曲
- 只有文件支持--cookie标志
截图
- 项目
标签: