Title: Musopen + Python = pymusopen
Date: 2012-03-07 09:09

# Musopen

> Musopen ([www.musopen.org](http://musopen.org)) is a 501©(3) non-profit focused on
> improving access and exposure to music by creating free resources and
> educational materials. We provide recordings, sheet music, and
> textbooks to the public for free, without copyright restrictions. Put
> simply, our mission is to set music free.

Musopen is a great site, but it provide radio only through an awful
flash player.

# Flash sucks

A quick look at the [source code of the page](view-source:https://musopen.org/radio/)
show that the player’s url is `/scripts/flash/mp3_player.swf`.
Once we get it, [flasm](http://nowrap.de/flasm) show us the ugly flash bytecode, who tell us
that the applet get the path of the file to play on the [playlist.php]( http://musopen.org/playlist.php )
webpage.

# Python rocks!

Some pythonic magic later, with
[pygst](https://gstreamer.freedesktop.org/modules/gst-python.html) and
[pygobject](http://www.pygtk.org/), we’ve got
a nice simple stupid python powered radio ! You can get the
code [here]({static}/files/pymusopen.py).

Sometimes, the `playlist.php` page returns garbage, I don't know why.
