How to download aes encrypted m3u8 using ffmpeg or youtube-dl?
6,566
You can use ffmpeg like so:
ffmpeg -i video.m3u8 -c copy -bsf:a aac_adtstoasc video.mp4
Also if the urls are https you can add https to allowed protocols like so:
ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i video.m3u8 -c copy -bsf:a aac_adtstoasc video.mp4
Original article: Download encrypted HLS content with ffmpeg - davd.io
Related videos on Youtube
Author by
weakplayrxw
Updated on September 18, 2022Comments
-
weakplayrxw almost 2 years
I have the m3u8 file and the key.bin, inside the m3u8 file is:
#EXTM3U #EXT-X-VERSION:4 #EXT-X-PLAYLIST-TYPE:VOD #EXT-X-INDEPENDENT-SEGMENTS #EXT-X-TARGETDURATION:6 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-KEY:METHOD=AES-128,URI="key.bin" #EXTINF:6.000000, segment-0.ts ... #EXTINF:4.416667, segment-159.ts #EXT-X-ENDLIST
and inside the key.bin file is
Ú{±€rl”ÜJÌy«‡mó
How do I download this as an mp4 using ffmpeg or youtube-dl?.
-
Kamil Maciorowski over 3 yearsYou can share the knowledge then.
-
weakplayrxw over 3 yearsyoutube-dl -o file.mp4 "m3u8-URL" might need to pass proper headers for youtube-dl/ffmpeg to be allowed to download the key. use --user-agent "" and --referer "" (use same user-agent as your browser, find yours easily at ifconfig.me/ua, and referer is the main URL in the browser from where you sniffed out the m3u8 URL) ( Thanks goes to the guy from reddit who gave the solution.)
-
-
gronostaj over 3 years-1 because the answer is basically unreadable