How Do I Add iHeartRadio Stations to Radio Tray?

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?


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.


Summary

The list of stream URLs for the iHeart radio stations is found here.

Look for the stream tag stream_url_v2 and copy the URL. Paste this into RadioTray

Detail

Copy the URL from the link provided above

enter image description here

Choose Configure Radios... from Radio Tray

enter image description here

Add the entries shown - paste the URL via CTRL+V

enter image description here

Select iHeart from the RadioTray list.


I heart radio has updated their interface. Now do the following:

  1. open up the web inspector in your browser or view the source code.
  2. look at the source code for the phrase "shoutcast_stream", it should be the key and it's value is the link you are looking for that is compatible to stream.
  3. open cmus. once in the interface, type :add [url from step2].
  4. the stream should start playing automatically.

I confirmed this and go WDVE working in cmus by the following on OS X:

brew install cmus then cmus then once in cmus interface type :add followed by the link you just found in step 2, in my case it was:

http://wdve-fm.akacast.iheart.com/7/364/20061/v1/auth.akacast.akamaistream.net/wdve-fm

Enjoy radio music from the command line.


It has changed yet again, none of the wireshark solutions, or searching for certain texts in the inspect tab of chrome/firefox helped, but I figured it out...

The example I'll be using is: I heart Mix 90.1 Toluca https://www.iheart.com/live/mix-901-toluca-6566/

  1. Click on the Share icon, it's the one to the right of the 'connect' button.

  2. Look for the Embed Widget section.

  3. Then copy from the end of src=". Example: The whole text is

    <iframe allow="autoplay" width="100%" height="200" src="https://www.iheart.com/live/mix-901-toluca-6566/?embed=true" frameborder="0"></iframe>```
    

    and I will copy https://www.iheart.com/live/mix-901-toluca-6566/?embed=true

  4. Ok, great. Now we have much less HTML and URLs to work with. Now copy that URL and paste it in your web browser (you can now close the previous radio webpage). Rick click the play button, select Inspect.

  5. Now, using Ctrl+F (press only Ctrl and F), look for stream. You should get several results, but they will be all on the same text line, so don't worry.

  6. Now double click in that load of JSON data, should start with something like {"initialPropos" : {....., now copy all that text and paste in a text editor which will let you search through text (e.g. vim, notepad, MS Word)

  7. Now, open the text editor with the pasted text. Now look for streams. The first result should start with something like: ,"streams":{"hls...

  8. Great! Now you may copy the stream of your liking, some may not be available, but in this example, the following stream types are available:

     {
       "hls_stream":"http://playerservices.streamtheworld.com/api/livestream-redirect/XHENOFMAAC.m3u8",      
       "pls_stream":"http://playerservices.streamtheworld.com/pls/XHENOFMAAC.pls",        
       "secure_hls_stream":"https://playerservices.streamtheworld.com/api/livestream-redirect/XHENOFMAAC.m3u8",
       "secure_pls_stream":"https://playerservices.streamtheworld.com/pls/XHENOFMAAC.pls"
     }
    
  9. Now, you may choose the stream of your liking and open it with your favorite audio/video player. E.g. (be sure to put it in double quotes so it won't get manipulated by your shell or smth)

    mpv "http://playerservices.streamtheworld.com/api/livestream-redirect/XHENOFMAAC.m3u8"
    
  10. The End! Now you should be good to go! If I was not at all clear, please tell me so. The only reason I've created a stack overflow account is to post this and help others know how to do this, so please let me know if this is not working!!

Cheers.

(yes, this is a repost answer from here, made by myself and with my express consent to share by myself.