Skip to content

Instantly share code, notes, and snippets.

@adamvr
Created December 16, 2010 22:57
Show Gist options
  • Save adamvr/744168 to your computer and use it in GitHub Desktop.
Save adamvr/744168 to your computer and use it in GitHub Desktop.
A bash one liner for generated m3u playlists that are can include any files on the file server, rather than just in a local directory
$ ls ./maus/music/Stevie\ Ray\ Vaughn\ and\ Double\ Trouble/Texas\ Flood/*.mp3
| sed 's/^\./http:\/\/red.act.ed/'
| sed 's/ /%20/g'
> playlist.m3u
Which produces a file of the form:
$ cat playlist.m3u
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/01%20Love%20Struck%20Baby.mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/02%20Pride%20and%20Joy.mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/03%20Texas%20Flood.mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/04%20Tell%20Me.mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/05%20Testify.mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/06%20Rude%20Mood.mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/07%20Mary%20Had%20A%20Little%20Lamb.mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/08%20Dirty%20Pool.mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/09%20I'm%20Cryin'.mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/10%20Lenny.mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/11%20SRV%20Speaks.mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/12%20Tin%20Pan%20Alley%20(AKA%20Roughest%20Place%20in%20Town).mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/13%20Testify%20(Live).mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/14%20Mary%20Had%20A%20Little%20Lamb%20(Live).mp3
http://red.act.ted/maus/music/Stevie%20Ray%20Vaughn%20and%20Double%20Trouble/Texas%20Flood/15%20Wham%20(Live).mp3
Naturally, this requires that "./maus" be a direct mapping to the URL http://red.act.ed/maus
Also it may be necessary to escape '/'s etc. but this'll do for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment