Kevin Mehall

Syncing Rhythmbox with a Portable Player

2009-01-18

logo

The default GNOME music player, Rhythmbox, lacks the ability to synchronize with a portable media player. There are some plugins available for the iPod, but I could find none that sync to players, such as mine, that appear as a USB flash drive.

The widely-recommended solution is to use rsync to copy the music folder onto the device. That doesn't work if you want only certain playlists synchronized, or if most of your music is in Ogg Vorbis and your player supports only MP3, however.

So I wrote a python script that grabs the list of songs on a playlist using the Rhythmbox DBUS API, and synchronizes them to the player, re-encoding them to MP3 with LAME. When tracks are removed from the playlist, they also get deleted from the player.

The program reads a configuration file in the root directory of the player that tells it which playlists to sync to which folders, and allows configuring LAME options such as bit rate and quality.

This script, combined with Rhythmbox's Automatic Playlists to filter for rating and limit size, provides a really powerful way to manage music and podcasts on a portable player.

It's probably not currently usable for the average user (it needs a GUI configuration tool, among other things), but it works for me.

Source code is hosted on Launchpad at https://launchpad.net/rhythmbox-playlist-sync

Usage info from the README:

Usage: ./sync /media/player_name/ The '.sync-config' file in the destination directory will be read to determine what to do. Lines in the config file contain comma separated columns:
Dest folder, RB Playlist, Command Line opts for LAME, [additional opts] The only additional option currently supported is 'original-names', which preserves the original file name rather than generating names in the 'Artist - Title.mp3' pattern. An example config file is provided in the 'sync-config-example' file included with this package.