npm

Need private packages and team management tools?Check out npm Orgs. »

m3u8-reader

1.1.0 • Public • Published

m3u8-reader

travis npm license downloads

Read and parse m3u8 playlist into array

Example

input

#EXTM3U
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="chunked",NAME="Source",AUTOSELECT=YES,DEFAULT=YES
http://1.example.com/index.m3u8
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:10,

output

[
  { "MEDIA": { 
      "TYPE": "VIDEO",
      "GROUP-ID": "chunked",
      "NAME": "Source",
      "AUTOSELECT": "YES",
      "DEFAULT": "YES" 
    }
  },
  "http://1.example.com/index.m3u8",
  { "PLAYLIST-TYPE": "VOD" },
  { "EXTINF": "10" }
]

Usage

const m3u = require('m3u8-reader')
const fs = require('fs')
 
console.log(m3u(fs.readFileSync('test.m3u8', 'utf8')))

Related

License

MIT, 2016 (c) Dmitry Tsvettsikh

install

npm i m3u8-reader

Downloadsweekly downloads

618

version

1.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability