globocom/m3u8 ? reverse-engineered prompt
Reverse engineered prompt
Build me a Python library for working with HLS m3u8 playlists.
I want to be able to load a playlist from a URL, a local file, or a raw string, then inspect things like the segments, target duration, and other playlist info. I also want to be able to make changes in code and save the result back out as a valid m3u8 file or string.
Please make sure it supports the common HLS tags, including media playlists, master playlists, segment timing, encryption keys, discontinuities, byte ranges, and the newer partial segment style tags too. It should handle real world playlists without breaking on extra metadata.
Add a small, clean API that feels easy to use, and include tests that cover parsing, editing, and dumping playlists. If anything about the latest HLS spec matters, look up current docs online if you need to.
Are you gonna build this?
make sure you review the code using coderabbit