Update September 29, 2010:
NOTE: This article assumes you have ssh access to your Apple TV, and you are interested in using it as a bittorrent client. It’s a bit rough around the edges, but it’s (for now) meant for people that kind of already know this stuff, but need an extra tidbit of info to make it work. I’m open to all kinds of feedback on how to improve it.
DISCLAIMER: If you break or brick your Apple TV while doing this, don’t blame me. I cannot guarantee this will work, however, it’s working for me. Still here? Let’s get to work!
Since your Apple TV is always on anyway, you might as well use it as a bittorrent client. The simplest way to do this is to install rtorrent. However, the basic Apple TV rtorrent package is lacking some finesse. Nothing that 2 simple files and a few words form the command line cannot solve. Ready? Here we go.
Step 1. Install rtorrent Get the latest version from Google Code and follow instructions. It’s the usual upload-and-run-the-install-script. You should be fine. After installation, you should see rtorrent (an executable) in /usr/local/bin on your Apple TV. You can launch it if you like, to see if it works.
Step 2. Install screen screen is a very nice Unix tool (a multiplexer) that can do lots of useful stuff. Read more about it on Wikipedia. Alas, this nifty program is not installed on your Apple TV.However, once upon a time someone made a verty nice plugin for Apple TV 1.0 called ATVTorrents. Basically, we will try to rebuild the backend of this ATV 1.0 plugin, and we need the screen binary. You can extract it from the ATVTorrents package, or just get it here (I extracted it for you). Now, on your Mac (or PC if that’s your poison, but you’ll have to find an scp program yourself), go to the command line, change to the directory that holds the screen executable and type this:
scp screen firstname.lastname@example.org:~
You should see a response that tells you the file was transferred successfully. Now, ssh into your Apple TV and type this (the password you will be asked after the sudo command is frontrow).
sudo mount -uw /
mv screen /usr/local/bin/
chmod 777 /usr/local/bin/screen
echo export PATH=$PATH:/usr/local/bin > /etc/profile
The last command creates a default profile that automatically has access to the new stuff we install. If that interferes with your setup, you might want to create a profile for the frontrow user only. OK, we’re done here, now on to the next step.
Step 3. Install the LaunchAgent Now we have screen and rtorrent and we want to make them play nice. If you know ho wto work screen, you can probably figure out how to start rtorrent with screen. However, that’s not what we want. We don’t want to do anything, we just want it to start whenever the Apple TV does. So, what we do is, we take this file and we will place it in /Library/LaunchAgents. The file is a modified version of the plist that originally came with the plugin mentioned earlier. That’s why the name is still referring to Awkward TV (seems fitting). This file tells the Apple TV to launch rtorrent in the background (using screen) after it has been successfully booted. Which means rtorrent will always be running, which is good (for a bittorrent client). Transfer the file to your Apple TV (same as the screen file above, use the scp command). Then ssh into your Apple TV and type the following command:
mv org.awkwardtv.rtorrent.plist /Library/LaunchAgents/
If you get a message about a read only file system, repeat the sudo mount command you did before, and try again. You should not have to chmod this file, since it is not an executable. Now reboot your Apple TV (sudo reboot), get yourself a cup of coffee or whatever you feel like, and when the Apple TV is up and running, ssh into it and type screen -rd at the command line. You should see a nice empty torrent screen. Type Ctrl-A Ctrl-D to exit.
Step 4. Configure rtorrent (optional but recommended to prevent it from clogging your connection) Main thing to do is set limits for upload and download bandwith. Edit the file /Users/frontrow/rtorrent.rc on your Apple TV (it’s invisible because its name starts with a dot, but it’s there). Edit the lines that look like this:
# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 200 upload_rate = 20
How to edit this file?
Method 1: mount your Apple TV using afp and edit the file as if it were on your Mac.
Method 2: install nano (follow the instructions for installing screen) and type /usr/local/bin/nano .rtorrent.rc.
Done! Your Apple TV is now a bittorrent machine. How do you make it do stuff? Simple. You drop torrent files in the folder Torrents (located in the frontrow user’s home directory), and when the torrent is done, the result will be placed in your Movies folder. Want to check on rtorrent? ssh into your Apple TV and type screen -rd at the command prompt.