iTunesToRhythm

Transfer your ratings and playcounts between music players — iTunes, RhythmBox, Amarok, and Windows Media Player.

Two-way sync · iTunes (Mac) · RhythmBox · Amarok · WMP
Diagram of supported synchronization directions between players: iTunes Library is a one-way source, while Rhythmbox, Amarok, iTunes on Mac, and Windows Media Player all sync two-way.
Supported synchronization directions

Prerequisites

If you are running a desktop distribution of Linux (such as Ubuntu), you probably already have most of these installed.

Execution

  1. Download and extract iTunesToRhythm.tar.bz2.
  2. Move, copy, or mount all your music where RhythmBox or Amarok can find it (the folder structure doesn't matter).
  3. Import all your music into your new player (Amarok or RhythmBox).
  4. Copy or mount your iTunes Music Library.xml file to Linux if copying from iTunes. If going to or from Amarok or RhythmBox, skip this step.
  5. Run the following command:
    iTunesToRhythm.py -w -a ITunes\ Music\ Library.xml ~/.local/share/rhythmbox/rhythmdb.xml
  6. Manually resolve any ambiguities you are prompted for.
  7. Enjoy your music.
On a Mac, iTunes is supported directly by using itunes as the source or destination — so you could, for example, import from Amarok straight into iTunes. On Windows, Windows Media Player is supported by using wmp as the source or destination.

Examples

Copy statistics from RhythmBox to an Amarok MySQL database, excluding ratings:

iTunesToRhythm.py --noratings -a ~/.local/share/rhythmbox/rhythmdb.xml mysql -s musicserver -d amarok -u amarokuser -p verysecret

Copy ratings and playcounts from Amarok to iTunes on a Mac:

iTunesToRhythm.py mysql -s musicserver -d amarok -u amarokuser -p verysecret itunes

Usage

Usage: iTunesToRhythm [options] <inputfile>|itunes|mysql|wmp|amazonmusic <outputfile>|itunes|mysql|wmp|amazonmusic

Options:
  -h, --help           show this help message and exit
  -c, --confirm        confirm every match
  -w, --writechanges   write changes to destination file
  -a, --disambiguate   prompt user to resolve ambiguities
  -l, --fastandloose   ignore differences in file names when a file size
                       match is made against a single song; will not
                       resolve multiple matches
      --noplaycounts   do not update play counts
      --noratings      do not update ratings
      --twoway         sync both sides, giving precedence to the copy with
                       the higher play count
      --dateadded      update dates (iTunes to RhythmBox on Linux only)
      --useSongTitle   match songs by title instead of file size

  Amarok connection options:
    Options for connecting to an Amarok MySQL remote database

    -s SERVERNAME, --server=SERVERNAME
                       host name of the MySQL database server
    -d DATABASE, --database=DATABASE
                       database name of the Amarok database
    -u USERNAME, --username=USERNAME
                       login name of the Amarok database
    -p PASSWORD, --password=PASSWORD
                       password of the user
Specifying itunes uses a running iTunes instance for synchronization — on macOS (via appscript) or on Windows (via the iTunes COM API). Use wmp for Windows Media Player and amazonmusic to read from Amazon Music.

Supported players

Each backend can be read (used as a source). Most can also be written (used as a destination):

Two-way synchronization is available with the --twoway flag, which gives precedence to the copy with the higher play count.

Roadmap

  1. Investigate replacing the fragile Amazon Music cache reader with the official Amazon Music Web API (OAuth). Two caveats make this uncertain: (1) it is a partner program — the app's Login With Amazon security profile must be allow-listed and approved by Amazon Music, so it is not something an individual user can simply enable for personal use; and (2) even once approved, the API exposes no play counts and no star ratings, so it still can't drive a full ratings/playcount sync.
  2. Optional, lossy Amazon Music export: map star ratings onto Amazon Music's like / dislike state, since the API has no numeric rating field.
  3. Playlist synchronization across players.

Contact

Found a bug or have a feature request? Please open an issue on GitHub. The source lives at github.com/esanbock/ITunesToRhythm.