Digitally Reimported: listening to DI.fm in your audio player

May 6, 2016 11:07 am Published by Leave your thoughts

If you’re like me, you probably know the service Digitally Imported and likely you were much disappointed due to the fact that they’ve cut off any means for us to listen to the streams in a more convenient player like RadioApp and such.

However after some fiddling it turned out that the protection is next to nothing. Since circumventing it would not eliminate the ads, neither boost the quality (not implying you don’t deserve more — just the way it works 🙂 ), I thought, why not give it a try and make my hardware radio tuner be able to play DI again?

As a result, a modification of proxy2 was created and inserted into the tuner firmware. You can find it here: difmproxy.py.  You can also install and run it with this one-liner:

curl https://gist.githubusercontent.com/vladkorotnev/63a6d27a9a4426aabab7/raw/DIFMProx.py > difmproxy.py && chmod +x difmproxy.py && ./difmproxy.py

Then just set the proxy settings in your media player (i.e. VLC) to 127.0.0.1:3128

Screen Shot 2016-05-06 at 9.56.08

and try playing any DI.fm stream, such as http://pub7.di.fm/di_techhouse_aac.

Usually you would get thisScreen Shot 2016-05-06 at 9.51.05

But after setting up the proxy… boom!

Screen Shot 2016-05-06 at 9.54.01

Moreover, the proxy will not do anything to any other stream URLs you might try to play and just let them into your player as they are.

However, if you have an Nginx server at hand, you may as well want to set up your personal proxy server, as our friends at Densetos have suggested.

I am currently using this config file in order to have DI available on my whole local network:

server {
listen 80;
server_name difm.genjitsu.local;
resolver 8.8.8.8;

location ~ "\/pub([0-9]{1,3})\/(.*)" {
proxy_pass http://pub$1.di.fm/$2;
proxy_set_header Host "pub$1.di.fm";
proxy_set_header Referer "http://www.di.fm/trance";
proxy_set_header User-Agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36 DiFmProx/1.0";
}
}

which lets me to use a URL like http://difm.genjitsu.local/pub7/di_techhouse_aac to listen to DI.fm network-wide 🙂

Categorised in: ,


Leave a Reply

Your email address will not be published. Required fields are marked *