Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > Video stream recording
Register FAQ Members List Calendar Mark Forums Read

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-26-2014, 02:29 AM
sebastian sebastian is offline
Member
 
Join Date: Jun 2007
Posts: 81
sebastian is on a distinguished road
Default

Download encrypted YouTube livestreams


Hi guys,

this weekend I'd like to download a livestream from YouTube which won't get archived. Now I would like to learn, what I can do, if the stream would be encrypted. With my google search, I found the following info by the user "recover" on http://stefansundin.com/blog/452

Quote:

@sawl I’ve figured it out. It’s an encrypted “stream”, but thankfully, it’s not that difficult to decrypt. It’s obviously not live, that’s why there are no index.m3u8 requests. It only needs one, in the beginning, so it’s easy to miss.

A trick you can do to get a new index.m3u8 request is to change the quality. Download that index.m3u8 and open it with a text editor. One of the first lines will have: “#EXT-X-KEY:METHOD=AES-128″, then an URL which contain the key, and then an IV value which contains the initialization vector for the key. Download the key, it’s in binary so I recommend that you use wget, or your browser may insert HTML and crap into the file when you save it. Save the key as hlskey.txt.

Now that you have the keys, you must get the encrypted ts files. Instead of using mplayer in the post above, you should simply do a few regular expressions on the playlist entries so you get a nice wget script (use -O to specify the output filename). Then when you have everything, it’s time to decrypt the files. I use Linux commands below, but you can probably find openssl for Windows as well (or run in a VM).

Create a bash script:

Code:
hexKey=$(cat hlskey.txt | hexdump -e '16/1 "%02x"')
hexIV=990C276E28BC6B83E21A6D6F75483732
openssl aes-128-cbc -d -p -nosalt -iv ${hexIV} -K ${hexKey} -in encrypted.ts -out decrypted.ts
As you can see you must remove 0x from the IV. And obviously make a loop or something to go through all your ts files.

Then you can continue as normally and merge the ts files. Good luck!
So how could that work on a windows machine? For the encrypted stream itself, would it be a good method to get it via

Code:
ffmpeg -i “http://streamlocation.m3u8″ -c copy c:\FileName.ts
and the find a way to decrypt it? Or would ffmpeg mess the encrypted stream up?

It would be great if you could help me! :-)
Reply With Quote
 
Tags: ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 06:42 PM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons