Installations
npm install iptv-playlist-parser
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
18.17.0
NPM Version
9.6.7
Score
74.8
Supply Chain
97.5
Quality
75.5
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
freearhey
Download Statistics
Total Downloads
7,374,783
Last Day
115
Last Week
790
Last Month
4,413
Last Year
50,161
GitHub Statistics
129 Stars
130 Commits
34 Forks
17 Watching
1 Branches
4 Contributors
Package Meta Information
Latest Version
0.13.0
Package Id
iptv-playlist-parser@0.13.0
Unpacked Size
30.74 kB
Size
6.94 kB
File Count
25
NPM Version
9.6.7
Node Version
18.17.0
Publised On
31 Oct 2023
Total Downloads
Cumulative downloads
Total Downloads
7,374,783
Last day
15%
115
Compared to previous day
Last week
7.8%
790
Compared to previous week
Last month
8.8%
4,413
Compared to previous month
Last year
-95.3%
50,161
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Dev Dependencies
3
iptv-playlist-parser
It parses IPTV playlist and converts it to a regular JavaScript object.
Installation
1npm install iptv-playlist-parser
Usage
From string
1const parser = require('iptv-playlist-parser') 2// import parser from 'iptv-playlist-parser' 3 4const playlist = `#EXTM3U x-tvg-url="http://example.com/epg.xml.gz" 5#EXTINF:-1 tvg-id="cnn.us" tvg-name="CNN" tvg-url="http://195.154.221.171/epg/guide.xml.gz" tvg-shift="-4.5" timeshift="3" catchup="shift" catchup-days="3" catchup-source="https://m3u-server/hls-apple-s4-c494-abcdef.m3u8?utc=325234234&lutc=3123125324" tvg-logo="http://example.com/logo.png" group-title="News",CNN (US) 6#EXTGRP:News 7#EXTVLCOPT:http-referrer=http://example.com/ 8#EXTVLCOPT:http-user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) 9http://example.com/stream.m3u8` 10 11const result = parser.parse(playlist) 12 13console.log(result)
From file
1const fs = require('fs') 2const parser = require('iptv-playlist-parser') 3 4const playlist = fs.readFileSync('playlist.m3u', 'utf8') 5 6const result = parser.parse(playlist) 7 8console.log(result)
From URL
1const https = require('https') 2const parser = require('iptv-playlist-parser') 3 4https 5 .get('https://example.com/playlist.m3u', res => { 6 let data = [] 7 8 res.on('data', chunk => { 9 data.push(chunk) 10 }) 11 12 res.on('end', () => { 13 const playlist = Buffer.concat(data).toString() 14 15 const result = parser.parse(playlist) 16 17 console.log(result) 18 }) 19 }) 20 .on('error', err => { 21 console.error(err.message) 22 })
Output
1{ 2 header: { 3 attrs: { 4 'x-tvg-url': 'http://example.com/epg.xml.gz' 5 }, 6 raw: '#EXTM3U x-tvg-url="http://example.com/epg.xml.gz"' 7 }, 8 items: [ 9 { 10 name: 'CNN (US)', 11 tvg: { 12 id: 'cnn.us', 13 name: 'CNN', 14 url: 'http://195.154.221.171/epg/guide.xml.gz', 15 logo: 'http://example.com/logo.png', 16 rec: '', 17 shift: '-4.5' 18 }, 19 group: { 20 title: 'News' 21 }, 22 http: { 23 referrer: 'http://example.com/', 24 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5)' 25 }, 26 url: 'http://example.com/stream.m3u8', 27 raw: '#EXTINF:-1 tvg-id="cnn.us" tvg-name="CNN" tvg-url="http://195.154.221.171/epg/guide.xml.gz" tvg-shift="-4.5" timeshift="3" catchup="shift" catchup-days="3" catchup-source="https://m3u-server/hls-apple-s4-c494-abcdef.m3u8?utc=325234234&lutc=3123125324" tvg-logo="http://example.com/logo.png" group-title="News",CNN (US)\n#EXTVLCOPT:http-referrer=http://example.com/\n#EXTVLCOPT:http-user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5)\nhttp://example.com/stream.m3u8', 28 line: 2, 29 timeshift: '3', 30 catchup: { 31 type: 'shift', 32 source: 'https://m3u-server/hls-apple-s4-c494-abcdef.m3u8?utc=325234234&lutc=3123125324', 33 days: '3' 34 } 35 }, 36 //... 37 ] 38}
Testing
1npm test
Contribution
If you find a bug or want to contribute to the code or documentation, you can help by submitting an issue or a pull request.
License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
6 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.3
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to iptv-playlist-parser
esx-iptv-playlist-parser
A basic IPTV playlist parser
@iptv/playlist
An extremely fast M3U playlist parser and generator for Node and the browser.
m3u-parser-generator
Library to parse and generate m3u or m3u8 IPTV playlist files
@tunarr/playlist
An extremely fast M3U playlist parser and generator for Node and the browser.