Aria2 + Firefox 3
Posted by: Wael Nasreddine in Linux, TIP, tags: bash, command-line, cookies, download-manager, firefoxHello,
Do you like the famous wget? but you would like to have a more advanced program? Open your arms and welcome the aria2 software, I have been using it for more than a year now and I thought it deserve an article on my blog, specially the integration with firefox 3, we’ll discuss it later in this article…
Aria2 is a very good command line download manager it supports ordinary links, metalink and torrents as well, very fast and doesn’t use a lot of resources, it also supports up to 5 connection per mirror ( if you specify for example 10 mirrors for the same file and 5 connection to each one, you’ll get 50 simultaneous connections… ) and most importantly it supports reading cookies from firefox’s cookies file, the problem is that it doesn’t read cookies.sqlite ( the one used with firefox 3) but cookies.txt ( used in firefox 1 and firefox 2 ), in this article I will provide a workaround on how to use the cookies.sqlite file untill aria2’s developers come up with a better solution…
I used an alias for aira2c that loads the firefox cookies file automatically
alias aria2c="aria2c --load-cookies='${HOME}/.mozilla/firefox/eMxyzptlk/cookies.txt'"
But this does not work with firefox 3, I had to make a script called dumpcookies based on a small implementation that I have found here. The new alias would be something like this:
alias aria2c="dumpcookies -i '${HOME}/.mozilla/firefox/eMxyzptlk/cookies.sqlite' -o '/tmp/cookies.txt' &> /dev/null; chmod 600 '/tmp/cookies.txt' &> /dev/null; aria2c --load-cookies='/tmp/cookies.txt'"
This alias will make aria2c convert firefox’s cookies to a text file on each call and writes it to /tmp ( it also makes it readable only by your user so you’ll remain safe.. ), and call aria2c with the converted cookies… It doesn’t delete it though!!
The aria2 documentation and man page are also a good reading…
P.S: here’s the complete alias I use, it is optimum:
alias aria2c="dumpcookies -i '${HOME}/.mozilla/firefox/eMxyzptlk/cookies.sqlite' -o '/tmp/cookies.txt' &> /dev/null; chmod 600 '/tmp/cookies.txt' &> /dev/null; aria2c --file-allocation=none --load-cookies='/tmp/cookies.txt' -c"
P.P.S: here’s my alias file in case you don’t want to copy/paste….










Entries (RSS)
[...] Aria2 + Firefox 3 (Offsite Link) [...]