Skip to content

phoreverpheebs/m3u8v

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

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

m3u8 library for V

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published