skillfed

m3u8

Python m3u8 parser

m3u8 v6.0.0 1.6M downloads/30d#3,741 on PyPI2,276
Permissive license MIT DORMANT released

What it is and what it does

m3u8 is a Python parser for m3u8 playlist files, the manifest format used by HTTP Live Streaming (HLS). It reads m3u8 content from URLs, file paths, or strings and exposes the parsed structure as Python objects—segments, duration, media sequences, encryption keys, and dozens of other HLS tags. You can also serialize playlists back to m3u8 text format, making it useful for reading, modifying, and regenerating HLS manifests.

The package supports a large set of m3u8 tags defined in RFC 8216 and related HLS specifications, including basic playback metadata (#EXT-X-TARGETDURATION, #EXTINF), encryption (#EXT-X-KEY), adaptive streaming (#EXT-X-STREAM-INF), and newer extensions like partial segments (#EXT-X-PART) and content steering. Its only runtime dependency is backports-datetime-fromisoformat, and it requires Python 3.7 or later.

Use it for:

  • Parse HLS manifests from a video streaming server to extract segment URLs and playback metadata for custom player logic
  • Modify an existing m3u8 playlist (e.g., update encryption keys or segment paths) and write it back to a file
  • Extract timing and duration information from live or on-demand HLS streams for analytics or scheduling
  • Build tooling to validate or audit m3u8 playlists for compliance with HLS specifications

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses and generates m3u8 playlist files (HLS manifests) according to RFC 8216, supporting a comprehensive set of m3u8 tags and allowing you to load playlists from URLs, files, or strings and serialize them back to text.

Yes, if you need to work with m3u8 playlists. The package is stable, permissively licensed, has low install friction, and covers a comprehensive set of HLS tags. Maintenance is dormant but not abandoned; the last release was 2024-08-07 and the repository shows recent activity. No known vulnerabilities.

Install

m3u8 on PyPI

pip

pip install m3u8

uv

uv add m3u8

poetry

poetry add m3u8

Installing m3u8

Before you install

Low install friction; depends only on backports-datetime-fromisoformat. Maintenance is dormant (737 days since last release), though the repository remains active with a recent commit on 2025-01-31 and 2276 stars.

License in practice

MIT license is permissive; you can use this package freely in commercial and private projects with minimal restrictions.

Quickstart

import m3u8

# Load from URL or file
playlist = m3u8.load('http://videoserver.com/playlist.m3u8')
print(playlist.segments)
print(playlist.target_duration)

# Or load from string
playlist = m3u8.loads('#EXTM3U\n#EXT-X-VERSION:3\n#EXTINF:10.0,\nsegment.ts')

# Dump back to file
playlist.dump('output.m3u8')

Verify before relying

  • Whether the package handles all modern HLS extensions beyond RFC 8216 in practice, or if some listed tags have incomplete implementation
  • Performance characteristics when parsing large or deeply nested playlists

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 1 — backports-datetime-fromisoformat
Maintenance dormant — 737 days since the last release
Last repo commit
First released
Downloads 1,580,268/month — #3,741 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: m3u8-6.0.0-py3-none-any.whl

Tags

m3u8 playlist parserHLS manifest parsingm3u8 file readerHTTP live streaming parserplaylist format converter
hlsstreamingmedia-format

More WWW/HTTP packages