View Single Post
  #2  
Old 10-01-2009, 07:04 AM
Stream Recorder
 
Posts: n/a
Default

Re: How to download RTMP audio/video streams with freeware CooJah+Blader


How to get a secure token and How to download RTMP audio/video streams that use secure tokens:

If an RTMP resource you are downloading from requires authorization, Blader will pop up a dialog window shown below where you need to enter the secure token.

Then the download will continue.

How to get a secure RTMP token?
Different policies can be used to authorize RTMP clients. Different analysis is required to find out the tokens depending on the policy used.

The most popular solution is JW player. It supports two kinds of tokens: a dynamic token and a static token. A static token is hard coded into the SWF flash file of the player. Dynamic tokens are sent by server dynamically when playing.

How to get a static secure token for JW Player
To get a secure static token you need to get the .swf file of the player and decompile it. Then you can get the script files of the player and find the keyword "token". For JW Player the static secure token can be found in the RTMPModel.as or player.as.

How to get a dynamic secure token for JW Player
You can get a dynamic secure token by capturing HTTP GET requests coming to the RTMP server. The server returns an XML file like :
Code:
<?xml version="1.0"?>
<config>
<file>mp4:00/00/bb/f6</file>
<autostart>true</autostart>
<type>rtmp</type>
<token>be5a0ccc1fcecc10a6b16a7dbf561c1d8dcd87e9a9c7f6f159de8ec392ebc31b</token>
<streamer>rtmp://206.14.141.94/streamer</streamer>
<fullscreen>true</fullscreen>
<stretching>uniform</stretching>
<quality>true</quality>
<skin>http://www.xxx.com/4skin</skin>
<plugins>http://www.xxx.com/related</plugins>
<related>48118</related>
<bufferlength>10</bufferlength>
<bufferthreshold>15</bufferthreshold>
<maxbuffer>60</maxbuffer>
<keyframeinterval>2</keyframeinterval>
<bitrate>576</bitrate>
<displaybufferthreshold>1</displaybufferthreshold>
</config>
Find the token tag in the XML file and copy the token from it. In the example above the token is
Code:
be5a0ccc1fcecc10a6b16a7dbf561c1d8dcd87e9a9c7f6f159de8ec392ebc31b
To analyze HTTP GET requests you can use CooJah. It allows you to turn on "XML filter" and "Auto File Detect" function. This allows to capture XML HTTP GET requests. Please not that XML files can b compressed using gzip. Rename compressed files adding the gz extension and decompress them. After that open the decompressed file with a text editor or your browser.
Reply With Quote