I was reading topics' titles, and then I saw this one:
At first, he wanted to use aria2, but then he switched to rtorrent. rtorrent is great, but It's not good for scripting, so I don't use it. aria2 is the best way to download torrent files, within command line. But how?
I use this script, because sometimes aria2 stops downloading, but doesn't exit! It's not a big deal when you're near the computer, but when you go somewhere else, you can't check if it's downloading. So I wrote this little script:
#! /bin/bash if [ ! -x /usr/bin/aria2c ]; then echo "aria2c is not installed" exit 1 fi if [ ! -d ~/.torrentdl ]; then mkdir ~/.torrentdl fi while :; do for i in $@; do MAGNET=false if [[ "$i" = magnet* ]]; then MAGNET=true elif [ ! -f "$i" ]; then echo "The file ('$i') is not given or does not exist" exit 1 fi if ! aria2c --hash-check-only=true "$i" &> /dev/null; then aria2c "$i" sleep 30m && kill -9 `pidof aria2c` else echo "Torrent is downloaded!" fi done done
Simply, it starts downloading and restarts it every 30 minutes.
There are some arguments that will help you with aria2:
Print file listing of ".torrent", ".meta4" and ".metalink" file and exit. In case of ".torrent" file, additional information (infohash, piece length, etc) is also printed.
If true is given, after hash check using --check-integrity option, abort download whether or not download is complete.
Maybe this belongs in the wiki, specifically the "Useful Tips and Tricks" section. It is not vital to usage of aria2, but I am sure there are others that might find this useful, and the wiki seems like a much more logical place to go searching for something like this.
Thanks for suggesting
https://wiki.archlinux.org/index.php/Ar … .26_Tricks