Create extended M3U playlist from mpc playlist
Just a simple “oneliner” to create an .m3u file from an mpc playlist.
If you are statisfied with the output redirect stdout to myplaylist.m3u
.
mpc -f "##EXTINF:%time%,%artist% - %title%\n%file%" playlist | perl -F: -p -e 'if (/^#EXTINF/) {$sec=$F[1]*60; $F[2] =~ s/(^.+),/$1/; $sec += $F[2]; s/^.+,(.+)/#EXTINF:$sec,$1/;}' |