Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reklatsmasters/m3u8-reader
Read and parse m3u8 playlist into array
https://github.com/reklatsmasters/m3u8-reader
m3u m3u8 m3u8-playlist m3u8-reader mpegts playlist
Last synced: 24 days ago
JSON representation
Read and parse m3u8 playlist into array
- Host: GitHub
- URL: https://github.com/reklatsmasters/m3u8-reader
- Owner: reklatsmasters
- License: mit
- Created: 2016-05-01T14:23:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-02T18:48:37.000Z (about 5 years ago)
- Last Synced: 2024-10-09T10:14:59.592Z (29 days ago)
- Topics: m3u, m3u8, m3u8-playlist, m3u8-reader, mpegts, playlist
- Language: JavaScript
- Homepage:
- Size: 81.1 KB
- Stars: 17
- Watchers: 2
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# m3u8-reader
[![travis](https://travis-ci.org/reklatsmasters/m3u8-reader.svg)](https://travis-ci.org/reklatsmasters/m3u8-reader)
[![npm](https://img.shields.io/npm/v/m3u8-reader.svg)](https://npmjs.org/package/m3u8-reader)
[![license](https://img.shields.io/npm/l/m3u8-reader.svg)](https://npmjs.org/package/m3u8-reader)
[![downloads](https://img.shields.io/npm/dm/m3u8-reader.svg)](https://npmjs.org/package/m3u8-reader)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
```json
[
{ "MEDIA": {
"TYPE": "VIDEO",
"GROUP-ID": "chunked",
"NAME": "Source",
"AUTOSELECT": "YES",
"DEFAULT": "YES"
}
},
"http://1.example.com/index.m3u8",
{ "PLAYLIST-TYPE": "VOD" },
{ "EXTINF": "10" }
]
```## Usage
```js
const m3u = require('m3u8-reader')
const fs = require('fs')console.log(m3u(fs.readFileSync('test.m3u8', 'utf8')))
````## Related
* [m3u8-write](https://github.com/ReklatsMasters/m3u8-write) - create .m3u8 playlist from an array of objects
* [m3u8-stream-list](https://github.com/ReklatsMasters/m3u8-stream-list) - read list of streams from .m3u8 playlist## License
MIT, 2016 (c) Dmitry Tsvettsikh