rtorrent批量添加magnetlink

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!/bin/bash
cnt=1
cd /home/gyx/watch || exit    # set your watch directory here
cat 1.txt|while read i 
do
[[ "$i" =~ xt=urn:btih:([^&/]+) ]] || exit
echo "d10:magnet-uri${#i}:${i}e" > "${cnt}.torrent" # name .torrent file by variable cnt
cnt=$[cnt+1]
done