Reverse Engineering an HLS Video Delivery Pipeline
When a video plays normally inside a browser, most of the underlying delivery system remains invisible. A user sees a video player, presses play, and the browser takes care of everything else. Behind that simple interface, the application may retrieve a playlist, request encryption keys, download hundreds or thousands of media segments, decrypt those segments, feed them into a MediaSource object, and finally present the resulting stream through the HTML video element. I recently had to investigate exactly this kind of setup on a custom learning management system. I had permission to download the course videos, but the LMS did not provide an obvious download option. Instead of trying to guess where the original video file lived, I wanted to understand how the browser itself received and played the media. The investigation eventually uncovered a conventional HTTP Live Streaming pipeline built around an M3U8 playlist, AES-128 segment encryption, MPEG-TS media segments, Bunny CDN deliver...