09 October
2017

Still working as of 2016

Streaming radio has been a common use of the Internet for many years. At one point, almost all audio streaming had only limited commercial implications. As the use of advertising has become more important as a source of revenue for radio stations, audio streams on the Internet have become entwined with players, typically flash-based, that serve advertising, collect user data, and provide other services. One side effect of this is that it can may it very difficult to debug the set of network connections being used. If, like me, you run a tight firewall, you need to have a sense of where data is coming from, and going, to allow the ports to be opened and closed.

Thus, I needed to figure out how audio streams were being sent from an audio station I wanted to listen to. The audio stream I wanted was being provided from streamtheworld.com and the actual transactions are handled by a rather complex mess of javascript and flash objects. Hers's how to find the streams using wireshark, a fancy network analysis tool.

There are two steps which I elaborate below:
1) Find the call sign for the station. With luck, you can guess this. This will often (but not always) be related to the station's familiar name. For example, for the station Q107 in Toronto the nationally registered call sign is CILQ and the callsign for streamtheworld.com is CILQFM; sensible. On the other hand, the streamtheworld identifier for CBMT CBC Radio One Montreal is CBC_R1_N_MTL_H.

2) Find the playlist (.pls file) or stream ID.

Call sign identification



Firstly, note that wireshark is a very powerful open-source network analyzer (once known as ethereal). It can be downloaded free for most platforms and runs using the X-windows windowing system (that works on Linux [default], Mac [standard but optional] and [with some effort] Windows).


Turn on packet capture in Wireshark and then using your browser on the same computer load the page with the stream you want.

Enter (i.e. specify) a filter as follows (see the picture):
tcp contains "callsign"
that will be used to "listen in" on the data exchange.
This should return an HTTP GET statement of the probable form:
GET /xmlconfig.php?view=xml&callsign=CILQFM&streamid=86
and an associated full URI of the form:
http://playerwebadmin.streamtheworld.com/xmlconfig.php...
It's the callsign argument you want (in this case, CILQFM, for example).


Getting the callsign using wireshark
Getting the callsign using Wireshark (click to expand)






Play list via wireshark



At this point, you can just go to
http://provisioning.streamtheworld.com/pls/CILQFMaac.pls
to get the playlist, which can be used to see what's really happening.
Note the use of the CILQFM call sign in the URL.


Playing the stream without needing wireshark



Once you have the play list, you can directly inspect it to determine the ports in use. You can also drag it into Apple's iTunes.

If you know the callsign and just want to play the live stream, or see how this can be done programmatically, then there is a nice python script available from Dan McGee at http://www.toofishes.net/blog/streamtheworld-streams-command-line/.

[ Originally posted 2012/10/15, minor updates, Oct 2017. Apparently this still works. ]

By Gregory Dudek at | Read (8) or Leave a comment |    
Comments
Re: How to find an audio stream from streamtheworld.com

I tried your method to get WFAN to work on my Sonos system but it still doesn't connect, it used to work, but I guess CBS changed their format or are blocking streams outside of the US

http://provisioning.streamtheworld.com/pls/WFANAM.pls

Yes, many stations present unique challenges. I'm sorry it didn't work out, especially since the pld file you mentioned seems to have the right kind of "stuff" in it.

Posted by: Derrick at September 14,2013 08:21
Re: How to find an audio stream from streamtheworld.com

I found that in firefox I am able to select Web Devoloper -> Debugger from the Firefox menu then click on Network tab and refresh the page which has the stream. Then just find the StreamTheWorld url and right click and copy url address. paste to vlc and works flawlessly every time.

[ Thanks. -gd ]

Posted by: anonymous at December 10,2013 00:34
Re: How to find an audio stream from streamtheworld.com

I'd like to be able to create a link in iTunes 11.
Doesn't seem to work? Any ideas would be great.
I tried saving from VLC to a xspf and then importing into iTunes, no go. Tried manually adding into iTunes, won't play.
Thanks
Later

Posted by: anonymous at February 02,2014 14:04
Re: How to find an audio stream from streamtheworld.com

I stumbled upon here trying to figure out why streams from Stream The World would bomb out after a commercial/ad played. Then I noticed your streamtheworld.com link where you can download the .pls file. I hadn't come across that before, and now because of that one link, my mpd streams are happy because of you. Thanks a ton for teaching me that link!

[ Glad I could help. Feedback like that helps keep me motivated. -gd ]

Posted by: nixternal at December 10,2014 15:10
Re: How to find an audio stream from streamtheworld.com

Hi, thanks the post, I was streaming a station before, I used wireshark to see the address for the stream, the official application that plays the stream displays "commercial playing" when a commercial is playing, I always get the same commercials, which are from 2 or 3 years ago, if I stop and start the stream again it will play the actual commercial that is on the radio, I've now followed your instructions to get the pls and I got several addresses, I wrote an script to download them all at the same time and I get the same audio from all of them, is there any way to get the original stream without the replaced commercials? is there any way to detect that a commercial is playing? Thanks!

[ Thanks for the feedback. I suspect it's being injected into the audio stream and there is no clean way to detect the change in content. Feel free to leave the URL for the audio in a comment though, in case somebody has an idea. -Greg ]

Posted by: Iktwo at February 06,2015 15:24
Re: How to find an audio stream from streamtheworld.com

Professor Dudek, thank you very much for this helpful comment. It enables me to listen to my favorite live stream on an IPad, because it doesn' t support flash.

Keep up your good work.

Jazzflyer

[ Hey, thank's for the supportive feedback. Glad I could help. ]

Posted by: Jazzflyer at May 22,2015 11:36
Re: How to find an audio stream from streamtheworld.com

Posting in 2016, method posted works flawlessly! Can now listen in my desktop player instead of the webplayer that keeps playing the same ads and 'radio segments' they've been playing for the past 4 years...


[ Thanks for the feedback and update. -- Greg]

Posted by: anonymous at March 22,2016 09:13
Re: How to find an audio stream from streamtheworld.com

Still working in 2017. Thanks for this.



[Glad to hear it! You are welcome. --gd]

Posted by: anonymous at October 03,2017 02:22
Trackbacks
Please send trackback to:/blog/253/tbping
There are no trackbacks.
Post your own response

Each comment is manually screened for the presence of appropriate and substantive content, due to a constant onslaught of comment-spam. This means there may be a delay before your comment appears.


(Some kind of name is required, will be visible)

Required, whatever you enter will be visible to other users.


(Optional, used for "mailto" link)

Your email address is not required, but if you insert it it will be displayed so people can contact you.

Answer this question correctly to demonstrate that you are not a dumb spambot.



The title for your comment.



Your comment goes here. All relevant comments are welcome, except for those that simply promote an irrelevant product or else are used to fraudulently inflate the link count to an irrelevant web page. They appear after moderation. Don't forget to also fill in the captcha below or your text will be rejected automatically!

You must answer this question to prove you are human
What kind of restaurant has waiters, napkins, and pizza (enter a number): 1:Seafood, 2:Drive-through, 3:Pizzeria, 4:Reform school, 5:Roadside hot-dog stand?

Answer this question correctly to demonstrate that you are not a dumb spambot.