Repository

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

About

0
7
last May 7

Author

phoreverpheebs