Update (long ago): About a week ago, Clear Channel updated their internet stream again, this time to a flash based thing. Unfortunately, in this update they no longer serve the XML expected by this script to the Sonos user-agent.
If anyone has a way to grab the stream URLs from the new player, please leave a comment.
If you've been trying to play the KFI radio stream in an external media player like totem, mplayer, or VLC, you've no doubt suffered annoyance at the number of hoops you have to jump through to acquire it. Further, the url needs to be refreshed every few hours to get the new authorization code.
Luckily, there's a solution. If you set your User-Agent to "Sonos" when you go to the KFI player it will send an XML file containing the stream URL instead of redirecting to the new browser player.
You can change your User-Agent string in Firefox with User Agent Switcher, or you can fetch the url with
wget -U "Sonos" http://www.kfi640.com/cc-common/ondemand/player.html.
Once you have the file you can just copy the URL into the player of your choice.
Or you can use a Bash script that wget's the file, parses out the url with sed, and loads the results into totem.
I can't claim complete authorship of the bash script, as I found a version on a forum first, and have only subsequently made modifications to keep it working through Clear Channels streaming changes and to add a switch for another station I listen to.
Thanks. KFI and KNEW broke a couple of days ago. This fixed them.
ReplyDeleteGlad I could help.
ReplyDeleteIf the above link seems to not function try this:
ReplyDeletewget -U "Sonos" http://kfi640.com/cc-common/streaming_new/index.html
WOW! Thanks so much for this hint! It does make listening to CC Radio Streams way easier, working with almost all of them! Now for some strange reason, however, whenever I try listening to KFI using your method, I eventually get redirected to the K-TLK 1150 AM Stream. This is of course a Clear Channel Radio Issue. But I was wonderif if you have been happening to experience the same behaviour? Best Regards!
ReplyDeleteSorry for the comment delay, forgot it was moderated.
ReplyDeleteYes, I was having this problem, I never found a fix, and a few days later it fixed itself.