Connecting to StreamTheWorld Audio Stream Directly

by mr_cow

In this article, I'll show you how to connect directly to a StreamTheWorld (www.streamtheworld.com) audio stream without using the provided web client.

First, we go to the web page that has a client we suspect connects to a StreamTheWorld server, for this example I'll use the MMRadio client (www.mmradio.com/player/379).  We then view the source code of the web page to locate the SWF (Adobe Flash) file that loads the audio streaming control:

<script type=text/javascript>
player = function (est) { 
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="486" height="258">')
  document.write('<param name="movie" value="http://www.mmradio.com/sites/mmradio.com/files/players/TeleRadio.swf?'+est+'">')
  document.write('<param name="quality" value="high">')
  document.write('<embed src="http://www.mmradio.com/sites/mmradio.com/files/players/TeleRadio.swf?'+est+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="486" height="258"></embed>')
  document.write('</object>')
}
</script>

In this example, the SWF URL is located in the value parameter of the movie control:

http://www.mmradio.com/sites/mmradio.com/files/players/TeleRadio.swf

Next, we disassemble the SWF using Flasm disassembler and search for the stream's XML configuration.

For this page, the following part of the disassembled SWF builds the address:

push 'http://provisioning.streamtheworld.com'
setRegister r:2
pop
label68:
push r:2, '/streaminfo.php?CALLSIGN=', r:3, 'CALLSIGN'
getMember

We also search for the callsign:

push 'CALLSIGN', 'XEAWAM'

Now that we have the address for the XML config that the player uses, we open it in our web browser:

provisioning.streamtheworld.com/streaminfo.php?CALLSIGN=XEAWAM

The XML config contains the server, port, and mount parameters:

<config_stream>
<serverip>208.80.54.69</serverip>
<serverport>80</serverport>
<serverport_bak>3690</serverport_bak>
<mount>XEAWAM</mount>
<buffersize>90000</buffersize>
<messageconnection>CONNECTION IN PROGRESS...</messageconnection>
...

Next, we search for those variables in our previously disassembled SWF source code, to see if there are any other parameters that we might have to pass in the stream URL:

function2 StartStream (r:4='statemessage', r:7='serverip', r:5='serverport', r:6='mount') (r:1='_root')
  push r:_root
  setRegister r:2
  pop
  push UNDEF
  setRegister r:3
  pop
  push 1, r:statemessage, 2, r:2, 'event_changestatus'
  callMethod
  pop
  push 'urltoload', 'http://', r:serverip
  add
  push ':'
  add
  push r:serverport
  add
  push '/'
  add
  push r:mount
  add
  push '?streamtheworld_user=1'
...

In this case, the StartStream function assembles the audio stream address, so we assemble the address of the target audio stream as is done in the function and open that address in our web browser.

The server will return an MP3 stream:

http://208.80.54.69:80/XEAWAM?streamtheworld_user=1

Of course, the stream will be a really big file, so we only use the browser to check that we're returned an MP3.

If we are, we can then open it with Winamp, XMMS, VLC, or any other network audio stream client.  If we're returned an error, we have to see if there are any additional parameters we need to pass to the server to get the stream.

For more Mexican StreamTheWorld sites, a long list of stations organized by state can be found at Fred's Cantu (mexicoradiotv.com).

Return to $2600 Index