View Single Post
  #55  
Old 06-12-2014, 08:08 PM
ItsAngel ItsAngel is offline
Senior Member
 
Join Date: Jul 2012
Posts: 102
ItsAngel is on a distinguished road
Default

Re: I downloaded Netflix videos in HD, I can play off line,need a little help W/.key


Quote:
Originally Posted by enrud View Post
Code:
  $key = file_get_contents($argv[3]); 
  if ($key === false) 
      die("Failed to open key file."); 
  $iv = $key; 
  LogDebug("Key: " . hexlify($key)); 
  LogDebug("IV : " . hexlify($iv));
The IV isn't the same as the key.

According the HLS spec, if the IV isn't specified in the #EXT-X-KEY, which it isn't, then the IV is the sequence number. The #EXT-X-MEDIA-SEQUENCE tag specifies the starting sequence number for the playlist, in this case, 0. Each url in the playlist is a sequence. So the first url in this case is sequence #0, the second is sequence #1, etc.

The IV for each url is then encoded as a 128 bit big endian representation of the sequence number for that url.

So the first URL (sequence #0) the IV is \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x00\x00

For the second URL (sequence #1) the IV is \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x00\x01

and so forth.

I believe that's the reason why you can't decrypt.
Thanks for helping me out with this! we are definitely getting there! i do have a question though, where are you finding these urls and different .ts chunks? when i download a video it comes in only one .ts file.
Reply With Quote