itunes playlist export

More fun with itunes music player :)

Sometimes, itunes will stutter during playback. Winamp doesn't seem to have this problem. Playlist creation and management can be easier in itunes, but itunes' playlist cannot (easily) used in winamp. After spending some time looking at the file format for m3u and pls files, here's a little snippet to export a playlist from itunes into something that works with winamp: http://wliao.freeshell.org/tcl/itunes_playlist_export/itunes_playlist_export.txt .

It uses tcom, so windows only. There should be an equivalent with javascript or apple events... Track listings doesn't seem to work well with stream urls, and I don't have an videos.


Sample output:

    C:\>tclsh itunes_playlist_export.tcl
    list | export id path ? m3u | pls ? | tracks id

    C:\>tclsh itunes_playlist_export.tcl list
    1 - a 1202
    2 - {Party Shuffle} 21
    3 - Purchased 0
    4 - 1 25
    5 - 2.1 0
    6 - fiifer 113
    7 - fiifer.3hours 46
    8 - lunger 97
    9 - lunger.3hours 34
    10 - {seldom heard} 35
    11 - Videos 0
    12 - Zall_songs 1173
    13 - Zpurchased 72
    14 - {ZRecently Added} 25
    15 - {ZRecently Played} 89
    16 - Podcasts 25
    17 - stream 10


    C:\>tclsh itunes_playlist_export.tcl tracks 16
    list tracks in Podcasts
    1 - 3207 {On The Media - August 25, 2006} {C:\Documents and Settings\wl\My Documents\My Music\iTunes\iTunes Music\Podcasts\On The Media from NPR_WNYC\On The Media - August 25, 2006.mp3}
    ...

    C:\>tclsh itunes_playlist_export.tcl export 16 1.m3u

    C:\>tclsh itunes_playlist_export.tcl export 16 1.pls pls

    C:\>cat 1.pls
    [playlist]
    File1=C:\Documents and Settings\wl\My Documents\My Music\iTunes\iTunes Music\Podcasts\On The Media from NPR_WNYC\On The Media - August 25, 2006.mp3
    Title1=On The Media - August 25, 2006
    Length1=3207
    File2=C:\Documents and Settings\wl\My Documents\My Music\iTunes\iTunes Music\Podcasts\IT Conversations\1034 Simon Witts - Platform for the.mp3
    Title2=Simon Witts - Platform for the People-Ready Business
    Length2=2236

    C:\>cat 1.m3u
    #EXTM3U#EXTINF:3207,On The Media - August 25, 2006
    C:\Documents and Settings\wl\My Documents\My Music\iTunes\iTunes Music\Podcasts\On The Media from NPR_WNYC\On The Media - August 25, 2006.mp3
    #EXTINF:2236,Simon Witts - Platform for the People-Ready Business
    C:\Documents and Settings\wl\My Documents\My Music\iTunes\iTunes Music\Podcasts\IT Conversations\1034 Simon Witts - Platform for the.mp3