m3u8v
V library for decoding and encoding/generating m3u8 playlist files widely used in the HTTP Live Streaming protocol.
Features
- Supports playlists up to protocol version 7
- Allows for parsing media and master playlists
- Auto-detection for input streams
- Support for DRM systems and non standard Widevine tags
Installation
via vpm:
v install phoreverpheebs.m3u8
via git:
git clone https://github.com/phoreverpheebs/m3u8v.git ~/.vmodules/phoreverpheebs/m3u8
Examples
vhlsdownloader: https://github.com/phoreverpheebs/vhlsdownloader
import phoreverpheebs.m3u8
fn main() {
playlist := m3u8.decode_from_file('playlist.m3u8', true) or { panic(err) }
if playlist is m3u8.MasterPlaylist {
println(playlist.version())
println(playlist.variants)
eprintln('master')
} else if playlist is m3u8.MediaPlaylist {
println(playlist.version())
println(playlist.segments)
eprintln('media')
}
}
TODO
- Add examples
- Documentation
- Custom Tags
- Custom Decoder
- Protocol version 8
References
This repository was inspired by grafov's implementation of the protocol in Go https://github.com/grafov/m3u8
Other languages
-
https://github.com/grafov/m3u8
in Golang -
https://github.com/globocom/m3u8
in Python -
https://github.com/zencoder/m3uzi
in Ruby -
https://github.com/Jeanvf/M3U8Paser
in Objective C -
https://github.com/tedconf/node-m3u8
in Javascript -
http://sourceforge.net/projects/m3u8parser/
in Java -
https://github.com/karlll/erlm3u8
in Erlang