Have ideas to improve npm?Join in the discussion! »

    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

    40

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • avatar