Download encrypted HLS content with ffmpeg

Date: 2024/02/23
Last Updated: 2024-03-07T20:23:34.701Z
Categories: Tutorial
Tags: Tutorial, MacOS, Linux, M3U8, FFMPEG
Read Time: 1 minutes

HLS (HTTP Live Streaming) is a widely used streaming protocol that breaks video files into small chunks and serves them over HTTP. It's a popular choice for streaming video content on the web, and it's used by many platforms.

In this tutorial, I'll show you how to download encrypted HLS content.

Prerequisites

You'll need to have ffmpeg installed on your system.

Find the M3U8 file

The first step is to find the M3U8 file. This file contains the URLs of the video chunks and the encryption key.

You can find the M3U8 file by inspecting the network requests in your browser's developer tools when loading the page.

Download the M3U8 file

Once you have the M3U8 file, you can download it using ffmpeg:

ffmpeg -i "https://example.com/video.m3u8" -c copy -bsf:a aac_adtstoasc output.mp4

我登上那高山 自由地飞翔在那辽阔蓝天

我站在云端 脚下是一望无际的海面

我不再犹豫 我心中有爱

我不想放弃 只想离开


我飞过那高山 眼前是阳光灿烂辽阔蓝天

我穿过云海 脚下是一片金色的麦田

我不再犹豫 我心中有爱

我不想放弃 只想离开


我没有选择 一篇空白

我不要选择 我想离开

我没有选择 坠落尘埃

我不要选择 我想要自由自在

我没有选择 徘徊期待

我想要自由自在 快离开