Thursday, October 11, 2012

Aria2 shell script and batch file

I wrote a BASH shell script and a DOS batch file that can be used to download files using aria2 — Aria2 is a command-line tool for downloading files. The script and the batch file take 2 arguments; the first one is for the bittorrent hash in 40-digit hexadecimal number and the second one is for arbitrary one-word description.





aria2.bat can be used on Windows, and aria2.sh can be used on Linux and *BSD. Make sure that aria2c is in PATH. For example, if you want to download an ISO file for the OpenSUSE DVD, you would type something like:



aria2.bat 198472f5217d843cceb1a4c82233f009ed6608af opensuse-dvd-586


To find the value of a bittorrent hash (that long hex number), you can cut it from a magnet link you find on a Web site — Magnet links allow you to download actual files without first having to download bittorrent files (*.torrent). When you see a magnet sign, right-click on it to display the shortcut menu and select Copy Link Location.



btih-demo1

Then, paste it somewhere, for example, inside the URL address bar. The hash value comes after the btih: string.



btih-demo2

After you find the bittorrent hash, use it as the first argument to the script and make up anything for the second argument, as shown in the example above.


No comments:

Post a Comment

About This Blog

KBlog logo This blog seeks to provide a collection of interesting pictures found on the Web. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

Powered By Blogger