PyAMF Is Awesome
Posted By Quentin Carnicelli on February 3rd, 2010
The recent release of Pulsar 1.5.6 added support for XM Radio’s new Canadian “XM online+” service. While Canadian XM users previously used the normal “XM Online Radio” service, XM/Canada appears to have gone out on their own and created a custom player.
Upon further investigation, we saw that the site was using Adobe’s RPC system known as Action Message Format (AMF) for transferring data (such as station info, track titles, and more) between the Flash client and XM’s servers. This was discouraging as well. Rather than having easy access to data in simple plain text or JSON, getting it out of AMF would entail spending weeks implementing and debugging an AMF decoder/encoder in Objective-C.
Two things came to our aide though. The first is that although Pulsar has a user interface implemented in Cocoa/Objective-C, the backend that talks to SIRIUS and XM’s servers is implemented entirely in Python. The second is a lovely little Python library called PyAMF.
As you might gather from the name, PyAMF implements full support for Action Message Format in Python, including RPC. And thus getting the necessary data from XM online+, a task we thought would take us weeks to do, was up and running in under a day. Adding complete support for XM Online+ took us under a week in total, from start to finish.
We’d like to give our thanks to the PyAMF team for making their wonderful little library available. We’ve made a small donation, of 0×100 hex bucks (that’s $256 USD) to PyAMF, and we’d like to publicize them as well. For anyone that ever runs into an AMF problem like ours, we can say look no further than PyAMF.
Aaron McQuinn says:February 8th, 2010 at 11:30 am
Thank you! I’m Canadian and very much appreciate that Pulsar supports the new online-only subscription.