Reputation: 41
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 });
}
Upvotes: 3
Views: 24173
Reputation: 1
I am able to extract a link from the Firefox Inspector Panel (I'll try to attach a screenshot), and filter out everything but Network links and Media. These links, and there are many of them, only play little excerpts of songs. A few seconds, just enough to get your hopes up, then Radiotray stops playing and won't start again until you select another station.
Inspector Panel in Firefox, with Network and Media selected to filter out the rest of the results
This is the link I was able to get from the highlit entry.
link of the partial stream I was able to extract from the iHeart widget player button
Clicking on the link appears to be a deadend in Firefox, you enter it into the the radiotray-ng bookmarks editor and it will play for a few seconds.
Upvotes: 0
Reputation: 71
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/
<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
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.{"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
)streams
. The first result should start with something like: ,"streams":{"hls...
{
"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"}
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"
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.
Upvotes: 7
Reputation: 11
Find links off iHeartRadio: (I am using channel 93.3 as an example)
Upvotes: 1
Reputation: 1
> Find/search for..."icy"
This is not a reliable method since other servers may be used e.g. streamtheworld, edgefcs etc. - and some might use RTMP (which your player may not be able to handle)
Here is a Perl module & sample scripts which can do the job:
https://metacpan.org/release/IHeartRadio-Streams
reference: https://askubuntu.com/questions/470269/how-do-i-add-iheartradio-stations-to-radio-tray/470277
Upvotes: 0
Reputation: 31
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
Upvotes: 3
Reputation: 133
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.
Upvotes: 1
Reputation: 2292
I feel to stream a radio station you need a proxy server and ffmpeg setup, because multiple users will be connecting to stream via your website/webapp/app. ffmpeg on server side will read radio station stream (http stream or rtsp stream) and feed it to your streaming proxy server which will manage multiple connections.
Upvotes: -1