首页 > 服务器 > 百度网盘+aria2神器,欧耶~抛弃迅雷离线

作者:ghostry 发布时间:2013-10-11 浏览: 36018

转载注明出处: https://blog.ghostry.cn/server/434.html

aria2在ubuntu市场就有,直接装。然后我写了个脚本~

#!/bin/bash
stop() {
	# must interrupt it to save session
	killall -2 aria2c
	echo 'stop'
}
start(){
	usr_path=$HOME					#基础目录
	aria2_conf_path="$usr_path/.aria2"			#配置文件目录
	aria2_downloadfolder="$usr_path/下载"			#下载文件目录

	aria2_configfile="$aria2_conf_path/aria2.conf"		#配置
	aria2_downloadlist="$aria2_conf_path/aria2file.txt"	#下载任务列表
	aria2_DHT="$aria2_conf_path/dht.dat"			#dht数据文件
	[ ! -d "$aria2_conf_path" ] && mkdir -p "$aria2_conf_path"
	[ ! -f "$aria2_downloadlist" ] && touch "$aria2_downloadlist"
	[ ! -f "$aria2_DHT" ] && touch "$aria2_DHT"
	[ ! -f "$aria2_configfile" ] && {
		cat > "$aria2_configfile" << EOF
# General Setting
#
continue
peer-id-prefix=-TR2610-
user-agent=Transmission/2.61 (13407)
event-poll=epoll
#on-download-complete=/etc/aria2/post

# Connection Setting
#
disable-ipv6
check-certificate=false
min-split-size=5M

# BitTorrent Setting
#
enable-dht
enable-dht6=false
enable-peer-exchange
bt-enable-lpd
bt-seed-unverified
bt-save-metadata
bt-hash-check-seed
bt-remove-unselected-file
bt-stop-timeout=900
seed-ratio=0.0
save-session-interval=60
EOF
		}
	seedtime=30			#做种时间
	diskcache="30M"			#磁盘缓存
	fileallocation="none"		#磁盘预分配
	download_limit="1M"		#总体下载速度限制
	upload_limit="50K"		#总体上传速度限制
	rpc_user=""			#管理帐号
	rpc_passwd=""			#管理密码
	btmaxpeers="20"			#每个种子最大peer数量,0为不限制
	maxthread="10"			#下载使用连接数
	maxjobs="1"			#同时开启任务数量

	cmd="aria2c -c -D --enable-rpc --rpc-listen-all=true --rpc-allow-origin-all \
	--seed-time=$seedtime --conf-path=$aria2_configfile --dir=$aria2_downloadfolder \
	--input-file=$aria2_downloadlist --save-session=$aria2_downloadlist --disk-cache=$diskcache \
	--dht-file-path=$aria2_DHT --file-allocation=$fileallocation --rpc-user=$rpc_user --rpc-passwd=$rpc_passwd \
	--max-overall-download-limit=$download_limit --max-overall-upload-limit=$upload_limit \
	--bt-max-peers=$btmaxpeers --split=$maxthread --max-connection-per-server=$maxthread \
	--max-concurrent-downloads=$maxjobs --listen-port=$tcp_port --dht-listen-port=$udp_port --force-save=true"
	[ "`pgrep aria2c`" != "" ] && {
	stop
	sleep 3
	}
	echo 'starting...'
	eval "$cmd"
}
restart(){
	stop
	sleep 3	
	start
}
case "$1" in  
start)  
        start  
        ;;  
stop)  
        stop  
        ;;  
reload|force-reload|restart)  
        restart  
        ;;
status|pid)  
        pgrep aria2c  
        ;;
*)  
        echo $"Usage: $0 {start|stop|restart|pid}"  
        exit 1  
esac 

方便启动,可以加到用户启动项里。参数start。
然后装一个http://userscripts.org/scripts/show/178301 插件(由于这插件添加任务带路径,我喜欢不带路径,所以我修改了插件http://blog.ghostry.cn/js/BaidupanAddAria2.js),百度网盘上就有了导出到aria2
然后你还需要一个看下载进度的图形界面http://blog.ghostry.cn/server/zuo-le-ge-aria2-wang-ye-guan-li-de-zhan-dian.html
ok

标签: aria2 下载

上一篇: qq盗号新的骗局来了
下一篇: ubuntu1310安装wps支持

已有 12 条评论 »

  1. 参看我的教程
    http://hi.baidu.com/meoow/item/25ea40d386ce37e7795daab9

    1. 现在好多网盘什么的,都屏蔽了这种下载.用着感觉很不爽.

      1. 搞。我天天用这个下迅雷离线,百度网盘,你告诉我哪屏蔽了,我伪装了UA,并且传递Cookie,只要Firefox的如DownThemAll之类的插件能下载,aria2 rpc就一样能下。

        1. 那应该是cookie的问题了.

  2. 厉害

  3. 你好,我的 aria2 rpc 启用了用户名密码,你的这个脚本怎么设置啊?

    1. 百度网盘的脚本不是我的呀。不过,带用户名密码的写法应该和ftp写法一样的。用户名:密码@地址

  4. 我也是喜欢不带路径的...有些路径还特无奈...都不搭边的...

  5. 高端

  6. Ubuntu被我本机装LMNPA弄SB了.
    现在只好在Windows环境码主题了

    1. 不要装lnmp啊
      一个一个自己装多方便

    2. 嘿嘿。不太熟就不要在真机装啦。我装服务器喜欢用新立得的工具。省心~

添加新评论 »

*
*

欢迎评论!歡迎評論!Comments welcome!komentoj bonvenaj!댓글 오신 것을 환영합니다!
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: :cold: :cryy: :cute: :shy: :sleep: :struggle: :tea: :yahou: