#Download all files from website ("01".."52").each {|i| `wget http://www.aularagon.org/files/espa/elquijote/p1/Parte%201%20Cap%C3%ADtulo-#{i}.mp3`} ("01".."74").each {|i| `wget http://www.aularagon.org/files/espa/elquijote/p2/Parte%202%20Cap%C3%ADtulo-#{i}.mp3`} #Rename files to remove accents and whitespaces Dir.foreach(".") do |f| unless (m = f.match(/Parte\s(.*)\sCap.+tulo-(.*)\.mp3/)).nil? File.rename(f.to_s, "P" + m[1] + "-Capitulo-" + m[2] + ".mp3") end end