It is really easy to create a web-based MP3 player. Just keep the files in a directory or a database and stream it over the web using HTML5 Audio or something. Well… the problem is that I don’t like easy.
I wanted something that shows the list of songs in a directory as hyperlinks. And on clicking the name of the song, the song should play – not on the client’s browser, but on the server.
Turns out, using Python, this can be done using only a few lines of codes (How much more were you expecting? Hail Python!!!)
The source code can be downloaded here.
P.S.: This player may have some problem with MP3 files that have some special characters (like ‘&’) in the name.