April 2008 Archives

Wed Apr 9 12:44:46 CDT 2008

btdownload: Command-line Bittorrent client (in Python)

Bittorrent is a great way to get Linux iso's. Not only can you get a fast download without killing the server of your favorite distro, but your bandwidth can be used to help distribute the file to others! The downside here is how easy it is to max your outgoing bandwidth, choking any outgoing services that you might run. On top of killing your personal website, browsing the internet from this machine will be painful. When your upload is maxed out, it can severely limit your ability to download web pages and even your torrents.

My favorite torrent client is a Python script called btdownloadcurses.py . It has several incarnations but I prefer the curses version. I choose the command line client over a GUI because it can be very painful to make a remote desktop connection while you download. With btdownloadcurses running in a screen session it is very easy to ssh home and check my progress.
screen -S bt #start a screen session named "bt"
btdownloadcurses --max_upload_rate 45 /path/to/file.torrent #My real max upload is around 55KB/s, so I can give 45 to my torrent.
^a d #"<ctrl>+a, d" detaches my screen session.

Another useful trick: when you want to download more than one torrent at a time, you can run them individually in different screen sessions or windows ("<ctrl>+a, c" creates a new window, then "<ctrl>+a, [p|n]" to select previous/next window in screen). Alternatively, you can use btlaunchmanycurses.py to start all the torrent files in a directory.

Two things to note with btlaunchmany:
  • Max upload will need to be calculated per file: if you are willing to put 45KB/s into uploads and have 3 torrents in the directory, you'll want to set max_upload to 15.
  • The normal client takes options before path, but btlaunchmany takes path first.
btlaunchmanycurses /path/to/torrents/ --max_upload_rate 15

This is a great way to seed several torrents that you've already finished downloading.

Posted by Nesman | Permanent Link