Struggling to obtain an online radio playlist
Hello!!
I record this radio for some personal use and last week they changed how the stream works. Previoiusly, you could just use the playlist URL directly to ffmpeg or VLC but now there’s some playlist validation using a SideBand Metadata ID (that’s what they call it). The problem is I’m not an expert scrapper and I don’t fully understand how backend works so I’m debugging the website but I’m going crazy coz I don’t really know what I should find to make the playlist work outside the website.
I think that usually is the server the one that generates the session, that’s what I see when I analyze other radios’ web traffic and I find an API call for example that returns the generated playlist url along with token/session ID. But in this case, I don’t see anything like that, instead, the playlist is generated from nothing along with a ‘sbmid’ parameter (Sideband metadata ID). That makes me think that it is generated locally and then the generated sessions get validated by the server somehow. And that’s what I’m trying to understand/find.
I found these functions inside ‘webpack:///src/modules/mediaplayer/sbm/SidebandMetadata.js’ :
getStreamConnectionUrl:function( url ) { return url + ( ( url.indexOf( "?" ) != -1 ) ? "&" : "?" ) + 'sbmid=' + this.__generateSessionId(); },
__generateSessionId:function() { var d = new Date().getTime(); this._sessionId = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = (d + Math.random()*16)%16 | 0; d = Math.floor(d/16); return (c=='x' ? r : (r&0x7|0x8)).toString(16); }); return this._sessionId; },
Btw, I tried putting a breakpoint on those functions but the debugger doesn’t allow me to get the local values… And I don’t understand why. Google told me that is due to how browsers optimize websites… I’m really bad at website debugging hahah
Anyway, I managed (I don’t remember how) to get the playlist url before it starts being used on the website when I was debugging, and seems that the required parameter for the playlist to work is ‘sbmid’, something like that:
https://18443.live.streamtheworld.com/CFBTFMAAC.aac?bmid=9d17382a-cdf4-4c56-a8e1-962995904a4a
But then if I close the website or I resume the execution the playlist stops working.
Btw, it is Canada geo-blocked, I use a VPN for that.
I don’t need you to fully analyze the website, but if you have any information about playlist generation, about stream sessions, or anything you think is related to my problem, please share it! And if you think it’s something and you actually find a way to make it work outside the website you can explain to me how, I would really really appreciate it!
Thank you in advance!
submitted by /u/Arufer720
[link] [comments]