[Request] .mp3 downloader for Ex.fm

in Ideas and script requests
Subscribe to [Request] .mp3 downloader for Ex.fm 7 posts, 4 voices

wmq User

Could anybody write script to download streamed music from Ex.fm?

Ex.fm is an online mp3 listening service. It collects music from many sources and allows to stream them.

You can't download songs from Ex.fm directly.
Currently I am using desktop app to download mp3s, Songr (https://sites.google.com/site/getsongr/).

It would be nice if this could be implemented.

Site URL: http://ex.fm/

Sample song: http://ex.fm/song/129a

Erik Lundmark Scriptwright

I'd be happy to do it, need something to keep my occupied tonight. I've already tested for any download hotlink protection, but it seem pretty straight forward. I tested this command and successfully downloaded a song:

wget --referer "http://ex.fm/song/129a" "http://a.tumblr.com/tumblr_lh918g6Yen1qaxi63o1.mp3" -O "exfm.mp3"

I'll post a link when the script is ready! :)

Erik Lundmark Scriptwright

UPDATE: Almost done! As I said though, this will be for Google Chrome / Safari only, but it won't require Tampermonkey :)

Some updates so far on what I've learned:
(Don't panic if you have no clue What I'm goin' on about :) it's just as a reference for us, and for anyone who happens to read this later and might give us a hand.)

* Ex.Fm uses HTML5 audio (>mp3) as playback. So Firefox is out. That's because the Flash object in it's place doesn't reveal the mp3 link. Or I should say; I don't know how to do that, but I think it's pretty hard none the less.
* The code on the page is Massive, 500KB compressed, so it took me a few hours to come up with a solution.
* I managed to force HTML5 by doing this at the top of the userscript:

unsafeWindow.EXAudioForceHTML = true;

I found it in the sourcecode, must be a thing the developer left behind.
By doing that I forced the mp3 link to appear in the audio element, so you CAN download with Firefox, you just can't PLAY anything.
In Google Chrome it was easy.

And because E.fm seems to stop yuo from playing the same song twice (for a while anyways), it's either playing it / downloading it with Gogole Chrome, or just downloading in Firefox.

So, playing songs AND downloading them will only work in Gogole Chrome, while doing this in Firefox would stop the playback ability, and only give you the download.

P.S. When I say Google Chrome only I mean a browser that can handle userscripts + HTML5 audio elements + MP3 supprt. Firefox only supports OGG. D.S.

Erik Lundmark Scriptwright

Finished, here's the link: userscripts.org/scripts/show/133728

MeLkOrAzO User

gracias Erik!

wmq User

Huge thanks! :D

LouCypher Scriptwright

It has API. It should be easy.