Ubuntu – How Do I Add iHeartRadio Stations to Radio Tray

internet-radio

I recently installed Radio Tray to my system so I could listen to iHeartRadio, but I don't know where to get the URLs of the Radio stations I like, How do I get them and how do I add them?

Best Answer

Many of the iHeartRadio stations are streamed through Akamai via akacast.akamaistream.net or similar. However, there are several different streams (yes, multiple streams) available. To get the station streams using Chrome:

  1. browse to your iHeartRadio station to listen
  2. right click the page and select View page source

There are several key javascript variables (as of this writing) used to identify the station and its streams.

  1. search (ctrl-f) for "streams"

The relevant text should be in a section of javascript in a variable "window.__store" (also near variable "BOOT"). The data is encoded using JSON. The "streams" area is a compound list of streams for the radio station as "streams":{"key":"value",...}. These key-value pairs list the stream type (key) and its stream (value).

You can use any of these streams that suit your purpose. For example, I get (formatted for clarity):

"streams" : {
  "hls_stream" : "http://c4.prod.playlists.ihrhls.com/3379/playlist.m3u8" ,
  "shoutcast_stream" : "http://kzps-fm.akacast.iheart.com/7/775/20092/v1/auth.akacast.akamaistream.net/kzps-fm" ,
  "secure_rtmp_stream" : "rtmp://cp20092.live.edgefcs.net/live/Dal_TX_KZPS-FM_OR@152687" ,
  "secure_hls_stream" : "https://c4.prod.playlists.ihrhls.com/3379/playlist.m3u8" ,
  "secure_shoutcast_stream" : "https://kzps-fm.akacast.akamaistream.net/7/775/20092/v1/auth.akacast.akamaistream.net/kzps-fm"
}

Now, you're good to go. I've tested all these streams by adding them as stations in Banshee. All but the "secure_rtmp_stream" work. If you want to use RTMP, you'll need to use other tools such as vlc, ffplay, rtmpdump, and flvstreamer.