Listen Digitally Imported Radio from CLI (without premium!)

mplayer http://pub7.di.fm/di_ambient_aac?1 -user-agent "AudioAddict-di/3.2.0.3240 Android/5.1"
This commands does just two things: fakes user agent (the one was taken from recent Android app) and sends the (possibly) listener ID (it can be any - I put "1" here because it works like a charm - after the name of stream ?1 as you can see). Look for the list of stations here: http://pub7.di.fm Or here: https://goo.gl/pdhhpQ Best regards, sxiii :)
Sample Output
Name   : Ambient - DIGITALLY IMPORTED - a blend of ambient, downtempo, and chillout
Genre  : Electronic Ambient Downtempo
Website: http://www.di.fm
Public : no
Bitrate: 64kbit/s
Cache size set to 320 KBytes
Cache fill:  0.00% (0 bytes)   
ICY Info: StreamTitle='Vangelis - Sushi Bar - Damask Rose (OST Blade Runner)';StreamUrl='';
Cache fill:  5.00% (16384 bytes)   

AAC file format detected.
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 56.60.100 (external)
[aac @ 0x7fa1abf39540]element type mismatch 1 != 0
AUDIO: 44100 Hz, 2 ch, floatle, 0.0 kbit/0.00% (ratio: 0->352800)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [pulse] 44100Hz 2ch floatle (4 bytes per sample)
Video: no video
Starting playback...

2
By: sxiii
2016-04-29 23:41:17

These Might Interest You

  • 1.- Enter into the playlist path. 2.- Run the command. 3.- Playlists created!


    2
    wget -q -O - http://listen.di.fm/public2 | sed 's/},{/\n/g' | perl -n -e '/"key":"([^"]*)".*"playlist":"([^"]*)"/; print "$1\n"; system("wget -q -O - $2 | grep -E '^File' | cut -d= -f2 > di_$1.m3u")'
    Zort · 2013-02-20 03:37:41 1
  • This command lets you select from 10 different BBC stations. When one is chosen, it streams it with mplayer. Requires: mplayer with wma support.


    23
    bbcradio() { local s PS3="Select a station: ";select s in 1 1x 2 3 4 5 6 7 "Asian Network an" "Nations & Local lcl";do break;done;s=($s);mplayer -playlist "http://www.bbc.co.uk/radio/listen/live/r"${s[@]: -1}".asx";}
    eightmillion · 2009-11-14 08:17:03 14
  • In order to do that, first you need to save a cookie file with your account info. These commands do it (maybe you need to create the '.cookies' dir before). Also, you need to check the "Direct downloads" option on the Premium Zone >> Settings tab. You need to do this once (as long you maintain the file or your Rapidshare Premium account).


    4
    wget --save-cookies ~/.cookies/rapidshare --post-data "login=USERNAME&password=PASSWORD" -O - https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi > /dev/null
    cammarin · 2009-03-28 09:12:02 3
  • Place it in your bashrc and running the command radio it will turn on or off each time it runs. Only one command needed. Obviously you can set it to any station you like.


    0
    radio() { if [ "$(pidof mpg123)" ] ; then killall mpg123; else mpg123 -q -@ http://173.236.29.51:8200 & fi }
    houghi · 2010-11-14 16:27:04 0

What Others Think

Also, to make a list of available streams, you can use command from here: http://www.commandlinefu.com/commands/view/11921/mpd-digitally-imported If somebody knows anything about premium streams I would be greatful to know how to connect to them.
sxiii · 108 weeks ago
Seems somebody has made a list (which does NOT require to send any user agent nor ID!) publically available here: https://gist.github.com/sim642/4f73e3e145fd1eac8c39
sxiii · 108 weeks ago
Alternatively, you could replace mplayer with mpv
nomasteryoda · 103 weeks and 2 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: