csdn_spider/blog/ds19991999/原创-- aria2简单下载脚本.md

42 lines
864 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 原创
aria2简单下载脚本
# aria2简单下载脚本
保存为 `bcloud`,修改权限 `chmod 755 bcloud` 就可以用了。
```
#!/bin/bash
# bcloud: bcloud downloud tool, rely on aria2.
# author: ds19991999
# date: 2018-09-26 16:35
# rely on:
# 1.baidu-dl: http://kks.me/aMrPx !important
# 2.aria2:
# sudo add-apt-repository ppa:t-tujikawa/ppa
# sudo apt-get update
# sudo apt-get install aria2
# usage:run bcloud at terminal.
DIR=/home/$USER
echo "-->Please enter urls for download."
echo -n "-->URL:"
read downloud
echo
echo "-->Please enter the save path(default:$DIR)."
echo -n "-->PATH:"
read dir
dir=${dir:-$DIR}
echo "-->The file will be downlouded at $dir"
echo
echo "-->Downlouding..."
aria2c --dir=$dir --max-connection-per-server=16 --max-concurrent-downloads=16 --split=16 --continue=true $downloud
```