3 releases
Uses new Rust 2024
| 0.1.2 | Jul 29, 2025 |
|---|---|
| 0.1.1 | Jul 26, 2025 |
| 0.1.0 | Jul 26, 2025 |
#268 in Video
89 downloads per month
16KB
312 lines
mediastream-rs
A library for parsing and generating m3u8 file.
Installation
cargo add mediastream-rs
or,
mediastream-rs = "*"
Usage
use mediastream_rs::Parser;
use std::io::Cursor;
// 1. Parse
let mut parser = Parser::new(Cursor::new(r#"
#EXTM3U x-tvg-url="test"
#EXTINF:1 tvg-id="a" provider-type="iptv",A
http://example.com/A.m3u8"#));
parser.parse().unwrap();
let result = parser.get_playlist();
// Do your works with result...
// 2. Generate
println!("{}", result.to_string());
Why make new wheels?
The existing crates do not meet my needs; they can either only parse m3u8 from a certain path (online or local) or cannot output the parsed m3u8 file back to m3u8.
License
MIT
Dependencies
~2–3MB
~53K SLoC