# We are expecting a m3u list of the CD tracks # which consists of the EXTINF information on a line # followed by the track path. # After ripping, we have .wav files that correspond # to the tracks. We need to rename them, encode them, # and set their information. # Ignore first line #EXTM3U 1{ /\#EXTM3U/d s/.*/Expected "\#EXTM3U" as first line - Got "&"/ q } # Check for UTF8 encoding (and discard) /.EXTINFUTF8:/d # Line should be in format: # #EXTINF:196,Seamus Haji - 17 Last Night A Deejay Saved My Life # ==>Seamus Haji # 17 # Last Night A Deejay Saved My Life s/.EXTINF:[0-9]\+,\(.\+\) - \([0-9]*\) \?\(.*\)$/\1\n\2\n\3/ tgotdataline s/.*/Expected mp3 data - Failed to parse "&"/ q :gotdataline N # Track01.cda ==> 01.wav s/\(.*\n.*\n.*\n\).*Track\([0-9]\+\).cda$/\1\2.wav/ tgottrackline s/.*/Expected track data - Failed to parse "&"/ q :gottrackline # Convert to "lame --preset insane --tt "Last Nig..." --ta "Seamu..." # --tl "ALBUM NAME" --ty "YEAR" --tn "17.." # 01.wm.. "ALBUM-17.[Seam..]-Last Nig...mp3" s/\(.*\)\n\(.*\)\n\(.*\)\n\(.*\)/lame --preset insane --tt "\3" --ta "\1" --tl "Anthems(1998-2008)" --ty 2008 --tn "\2" "\4" "Anthems(1998-2008)-\2.\1-\3.mp3"/