Raiper34 / m3u-parser-generator

Library to parse and generate m3u or m3u8 IPTV playlist files
https://m3u-parser-generator.netlify.app
MIT License
28 stars 11 forks source link

#EXT-X-KEY is not parsed. #13

Open tianfeng98 opened 2 months ago

tianfeng98 commented 2 months ago

This is a very good project, lightweight, simple, and commonly used. I think we also need to add some common parsing instructions, such as #EXT-X-KEY. Some videos are encrypted and need to be decrypted on the client before being played. The encryption information is described in #EXT-X-KEY, which can be found in the RFC documentation

Raiper34 commented 1 month ago

Hi, I added the ability to configure and parse custom unknown directives.

const customDataMapping: M3uCustomDataMapping = {
            '#EXTCUSTOMPLAYLIST': false,
            '#EXTCUSTOMMEDIA': true,
}
M3uParser.parse(playlistString, {customDataMapping})

See documentation https://m3u-parser-generator.netlify.app/interfaces/m3ucustomdatamapping Released under 2.0.0