[FFmpeg-user] How to download encrypted m3u8 providing the key?
matheusuzumakilol at gmail.com
Tue Jul 7 23:56:57 EEST 2020
Thanks, this worked! I replaced the key's URI to point to the local file
key and added the full path to the chunks on the external network. To
download I used the command "ffmpeg -protocol_whitelist
file,http,https,tcp,tls,crypto -allowed_extensions ALL -i gordelicia.m3u8
-c copy gordelicia.mp4". I can make a shell script to automate all of this
but it is strange that ffmpeg does not provide a easy way to set/replace
the decryption key on the command line
Em ter, 7 de jul de 2020 17:21, Moritz Barsnick <barsnick at gmx.net> escreveu:
> Hi Matheus,
> On Tue, Jul 07, 2020 at 14:45:08 -0300, Matheus Silva wrote:
> > Guys, how can I download from an encrypted m3u8 but that the key's URI is
> > no longer available? Obviously I downloaded the key previously, a 16 byte
> > file (that I get the hex string using "xxd -p"), I tried the following
> > using the cryptokey parameter but ffmpeg keeps trying to do the
> > using the key URI provided in the m3u8 file.
> I'm not sure you can override the key URI given by the HLS (m3u8). What
> you should be able to do is to download the m3u8, replace all the
> "URI=" in each "EXT-X-KEY:" line, retaining the "IV=", and expanding
> each segment to a full path, from e.g.
> Then use the local m3u8 file as ffmpeg's input.
> You may need some protocol whitelist or some "safe" flag on the ffmpeg
> command line, in order to be able to load content from file and
> network, but ffmpeg will probably tell you so.
> Good luck. I'm too lazy to convert your hex command line key argument
> back to a key file in order to test. ;-)
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-user