View Single Post
  #6  
Old 05-02-2012, 12:17 PM
KSV KSV is offline
Senior Member
 
Join Date: Apr 2011
Posts: 853
KSV is on a distinguished road
Cool

Re: RTMPDUMP and TOKEN


there aren't any special tricks used by website. it only uses a unique expiring token which many sites normally do. token is only valid for 2 minutes 20 seconds after which you need to grab new token. player sends following request to server and server provides tokenized url.

Code:
http://servicios.telecinco.es/tokenizer/tk3.php
POST Data:
Code:
id=cuatro&startTime=0&endTime=0&directo=wnEDAEVFRUWZFUD0WA+xIY2OlZvM47JMyKrnL+g=
Server Response:
Code:
<?xml version="1.0" encoding="utf-8"?>
<url>
  <file>telecincochannel4_800k?token=c3RhcnRfdGltZT0yMDEyMDUwMjEyMDczOSZlbmRfdGltZT0yMDEyMDUwMjEyMDk1OSZkaWdlc3Q9YzI1MTU3OGVjNWFiZjIxZTM0ZWYxMTU3M2UyNWMzODk=</file>
  <stream>rtmp://telecincolivefs.fplive.net/telecincolive-live</stream>
</url>
to make the request from your script you need to calculate the hash highlighted above in blue. AES-CTR is used to encrypt following data and then result is encoded by base64.

Data:
Code:
1335960574;cuatro;0;0
first argument is server timestamp. second is channel name. third and fourth argument is start time and end time respectively.

Encryption Key:
Code:
xo85kT+QHz3fRMcHMXp9cA
Sample Reference for AES-CTR implementation:
Code:
http://www.movable-type.co.uk/scripts/aes.html
Reply With Quote