Convert an XSPF playlist (e.g. exported from Quod Libet) into an M3U playlist suitable for Rockbox or Gonic.
- Converts XSPF playlists into M3U format.
- By default, writes Extended M3U (
#EXTM3U,#EXTINFentries). - Optionally strips path components up to a given folder name (default:
Music). - Can write minimal M3U files (no
#EXTM3U, no#EXTINF). - New: Gonic mode: emits Gonic headers and constructs full paths relative to a base library path.
git clone https://github.com/blockfeed/xspf_to_m3u.git
cd xspf_to_m3u
chmod +x xspf_to_m3u.pyxspf_to_m3u.py INPUT.xspf OUTPUT.m3u [options]-
--strip-after NAME
Strip everything up to (and including) the given folder name. Repeatable; first match wins. Default:Music. -
--no-extm3u
Write a minimal M3U (omit#EXTM3Uheader and#EXTINFlines). -
--gonic BASE_PATH
Write a Gonic-style M3U. BASE_PATH is the absolute library prefix (e.g./path/to/Music/).
Implies--no-extm3u. Prepends the headers:#GONIC-NAME:"<output filename stem>" #GONIC-COMMENT:"" #GONIC-IS-PUBLIC:"false"
Basic conversion (Extended M3U by default, strip after Music):
xspf_to_m3u.py library.xspf rockbox.m3uStrip after a custom library root:
xspf_to_m3u.py library.xspf rockbox.m3u --strip-after AudioMultiple anchors (first match wins):
xspf_to_m3u.py library.xspf rockbox.m3u --strip-after Music --strip-after LibraryMinimal M3U (no headers or EXTINF lines):
xspf_to_m3u.py library.xspf plain.m3u --no-extm3uGonic format:
xspf_to_m3u.py in.xspf gonic.m3u --gonic /path/to/Music/ --strip-after MusicProduces:
#GONIC-NAME:"gonic"
#GONIC-COMMENT:""
#GONIC-IS-PUBLIC:"false"
/path/to/Music/Artist/Album/Track.flac
...
GPLv3