how can i get the raw stream url of a iheartradio station.

16,356

Solution 1

You can use mitmproxy on a computer to inspect the traffic for the app. I was able to identify http://c10.prod.playlists.ihrhls.com/4342/playlist.m3u8 as the stream source of that radio station. Of course, the url may change over time, so ymmv.

Solution 2

I was able to find the iheart url by doing this... Go to desired radio station web site. Click on listen/play. Right click page then view page source. Find/search for..."icy" The first instance of "icy"should be here.. "shoutcast_stream":"http:// (various letters and numbers). playlists.ihrhls.com/(4 numbers) icy" I copy and pasted the http address into winamp and it worked.

http://c10icyelb.prod.playlists.ihrhls.com/4342_icy

Solution 3

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
  1. 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.
  2. 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.
  3. 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)
  4. Now, open the text editor with the pasted text. Now look for streams. The first result should start with something like: ,"streams":{"hls...
  5. 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"}
  1. 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"

  2. 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.

Solution 4

Find links off iHeartRadio: (I am using channel 93.3 as an example)

  1. Open iHeart radio and find your stream *NOTE: DO NOT START THE STREAM YET
  2. Use Wire Shark or any other capture tool and start the capture right before playing the stream on iHeart Radio
  3. Stop the stream then stop the capture immediately after (This limits the amount of packets we capture to only the ones we want)
  4. Use a filter and type in tcp contains "ihrh"
  5. Open all packets which include the link. *NOTE: Ignore any text which contains "ihrh" we are looking for a link
  6. Find server link (ex. c13.prod.playlists.ihrhls.com) *NOTE: make sure it is "c" and a number like "c13" NOT "cdn" or anything else
  7. Go in internet explorer and go to stream on iheart radio
  8. Look at url and notice the code (ex. https://www.iheart.com/live/channel-933-241/?autoplay=true&pname=fire&campid=local&callletters=khts-fm)
  9. Use server link and then add "/" then the code found from the step above
  10. Next, add the words "/playlist.m3u8" to the end of the link
  11. After completing all the steps you get the final link which is in our case : https://c13.prod.playlists.ihrhls.com/241/playlist.m3u8
Share:
16,356
Admin
Author by

Admin

Updated on August 04, 2022

Comments

  • Admin
    Admin almost 2 years

    i am trying to make a discord bot to stream the iheart80s at 103.7 radio station, and so far i can not find a direct stream url to give my discord bot.

    i have tried to get the json via python but that just returns http.client.BadStatusLine: ICY 200 OK

    i am using discord.js. and here is the function i am trying to feed the stream url into:

    function(CmdArg,CmdMsg){
      const voiceChannel = CmdMsg.member.voiceChannel;
      voiceChannel.join().then(connection => resolve(connection)).catch(err =>reject(err));
      const stream = () => {
               return request.get({
                   uri: CmdArg,
                   followAllRedirects: true,
                   encoding: null
               });
           }
    
    
        console.log(stream);
        CmdMsg.guild.voiceConnection.playStream(stream, { passes: token.passes    });
    }
    
  • Admin
    Admin about 7 years
    discord.js needs a readable steam in order to play audio to a discord channel.
  • Mohd Asim Suhail
    Mohd Asim Suhail about 7 years
    the architecture i proposed is highly scalable and easily monitorable and the stream generated by proxy server is streamable , so it wont be a problem for you to consume it in discord.js. And whats the reason for downvote for my answer whats is wrong in that