crispy-m3u
High-performance M3U and M3U8 playlist parser/writer for IPTV workflows.
What This Crate Is
crispy-m3u parses #EXTM3U playlists into structured Rust types and writes them back out. It is intended for IPTV applications, playlist import pipelines, migration tools, and cleanup utilities.
It focuses on the metadata commonly seen in real IPTV playlists, not just the minimal M3U format.
What It Provides
parse(&str) -> Result<M3uPlaylist, M3uError>write(&M3uPlaylist) -> String- stable ID generation for entries
- support for common IPTV metadata such as:
tvg-idtvg-nametvg-logogroup-title- catchup fields
- provider-specific extra attributes
Installation
[]
= "0.1.1"
MSRV: Rust 1.85
Quick Start
use ;
let input = "#EXTM3U\n#EXTINF:-1 tvg-id=\"cnn\" group-title=\"News\",CNN\nhttp://example.com/live/cnn.m3u8\n";
let playlist = parse.unwrap;
assert_eq!;
assert_eq!;
let output = write;
assert!;
Main Types
M3uPlaylistM3uHeaderM3uEntryM3uError
Typical Uses
- importing IPTV playlists into applications
- normalizing or cleaning playlists before further processing
- converting raw M3U into shared data models
- round-tripping playlists after edits
Related Crates
crispy-iptv-typesfor shared cross-protocol domain typescrispy-iptv-toolsfor deduplication, normalization, and filtering after parsing
Current Limitations
- the crate does not fetch playlists over the network
- malformed vendor-specific extensions may still need caller-side handling
- writing aims to preserve structured meaning, not exact byte-for-byte source fidelity
License
See LICENSE.md and NOTICE.md.