1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
#!/usr/bin/env ruby files = Dir["*.mp3"] files do |filename| mp3 = ID3Lib filename text = mp3 {|t| t[:id] == :TIT3 } # raise text.inspect mp3 {|t| [:TIT3, :COMM] t[:id] } mp3 = text[:text] mp3 = 'Indie' if mp3 =~ /^KEXP/ artist = mp3 artist(/^[\d]+ (.*)/, '\1') mp3 = artist end title = mp3(/ - /) title(0) mp3 = title(' - ') mp3 puts " ... converted ''" end |
Pastie