Created
August 24, 2012 15:26
-
-
Save ajvargo/3451979 to your computer and use it in GitHub Desktop.
Generate a randomly sorted m3u playlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dir.chdir '/Users/avargo/Music' do | |
File.open('../Downloads/all_random.m3u', 'w+') do |file| | |
Dir.glob('**/*.{mp3,ogg,wav}').shuffle.each do |song| | |
next if File.directory?(file) | |
file.write File.join(Dir.pwd, song, "\n") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment