https://github.com/freearhey/iptv-playlist-generator
A basic IPTV playlist generator
https://github.com/freearhey/iptv-playlist-generator
Last synced: about 1 month ago
JSON representation
A basic IPTV playlist generator
- Host: GitHub
- URL: https://github.com/freearhey/iptv-playlist-generator
- Owner: freearhey
- License: mit
- Created: 2023-02-26T13:28:42.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-28T12:20:58.000Z (about 2 years ago)
- Last Synced: 2025-03-25T09:49:23.081Z (about 2 months ago)
- Language: JavaScript
- Size: 213 KB
- Stars: 3
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iptv-playlist-generator
It can generate IPTV playlists.
## Installation
```sh
npm install iptv-playlist-generator
```## Usage
```js
const generator = require('iptv-playlist-generator')
// import generator from 'iptv-playlist-generator'const playlist = new Playlist()
playlist.header = { 'x-tvg-url': 'https://example.com/epg.xml', custom: 'value' }const link = new Link('http://example.com/stream.m3u8')
link.title = 'CNN (1080p)'
link.attrs = {
'tvg-id': 'CNN.us',
'tvg-name': 'CNN',
'tvg-url': 'http://195.154.221.171/epg/guide.xml.gz',
'tvg-logo': 'http://example.com/logo.png',
'group-title': 'News'
}
link.vlcOpts = {
'http-referrer': 'http://example.com/',
'http-user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5)'
}
playlist.links.push(link)console.log(playlist.toString())
```Output:
```
#EXTM3U x-tvg-url="https://example.com/epg.xml" custom="value"
#EXTINF:-1 tvg-id="CNN.us" tvg-name="CNN" tvg-url="http://195.154.221.171/epg/guide.xml.gz" tvg-logo="http://example.com/logo.png" group-title="News",CNN (1080p)
#EXTVLCOPT:http-referrer=http://example.com/
#EXTVLCOPT:http-user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5)
http://example.com/stream.m3u8
```## Testing
```sh
npm test
```## Contribution
If you find a bug or want to contribute to the code or documentation, you can help by submitting an [issue](https://github.com/freearhey/iptv-playlist-generator/issues) or a [pull request](https://github.com/freearhey/iptv-playlist-generator/pulls).
## License
[MIT](LICENSE)