The Opinionated Media Center
Downloading, organizing, and playing media are three separate tasks. I don't need a torrent client that has a built in video player like vuze, and I certainly don't need a media player that looks up album information and moves my files around like xmbc.
This guide will walk you through how to download, organize, and play your music and television shows the sensible way—with the best linux tool for each task.
Downloading
I wanted a simple bittorrent client that could handle:
- Watching a configurable directory for .torrents.
- Saving completed downloads to a configurable directory.
- Running more than one instance of the client at a time, with different configs.
All this insistence on configuration sounds excessive, but I wanted to run one bittorrent client per tracker I use. Keeping their files separate will make later steps simpler, and tuning throttling limits and minimum seed ratios per-tracker makes lot more sense to me than per-file.
The tracker that best fit the bill for me was…
rtorrent
To install on ubuntu, it's as easy as:
$ sudo apt-get install rtorrent
For each tracker, I created a watch directory for .torrents, a data directory for the completed files, and a session directory for rtorrent state.
Next, I wrote an rtorrent config file for each tracker:
Note that the port-range line should be different for each client, so they don't step on each other's toes. To starting rtorrent with a given config:
rtorrent -n -o import=~/incomplete/music/rtorrent.config
To add a torrent to the client, simply copy the file into the watch directory. For example, if your browser had downloaded a number of files from a tracker named totallyarealtrackername.com:
grep -l -Z totallyarealtrackername.com ~/Downloads/* | xargs -0 -I f mv f ~/incomplete/music/watch
Organizing
Next, the program you use to organize your recent download will depend (as it should!!) on the type of media.
beets is for music
beets is a command-line program that uses the musicbrainz database to tag files. Imagine if musicbrainz picard would shut up and get out of your way, and you've got beets.
Install:
$ sudo apt-get install beets
Configure:
And run:
beets import -q staging/music/
filebot is for television and movies
filebot is pretty simple and fast. It guesses the series and episode number based on the filename, looks up the metadata for that episode, and then renames the files using a format you specify.
Install:
$ sudo apt-get install filebot
Run:
find ~/staging/television/ -type f -print0 | xargs -0 filebot --action move --format '/home/foo/library/television/{n}/Season {s}/{n} {sxe} - {t}' -non-strict -rename
Playing Files
I dunno broheim, just use whatever old player you like. VLC is nice, but maybe you'd rather have something with more or different buttons.
Automation
One thing all of the tools I have listed have in common is that they do not require user interaction to do their thing. That means they can work seamlessly with cronjobs, makefiles, scripts—your current automation stack.
Tools that each do their own thing and work with your current workflow instead of forcing new ways of doing things on you. What a concept.