mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-13 10:30:03 -04:00
[Bot] Update playlists (#4600)
* Update Playlist.js * Install axios package * Create epg.js * Update db.js * Update format.js * Update Channel.js * Update db.js * Update generate.js * [Bot] Format playlists * [Bot] Remove duplicates * [Bot] Sort channels * [Bot] Update README.md * [Bot] Format playlists * [Bot] Remove duplicates * [Bot] Sort channels * [Bot] Update README.md Co-authored-by: Aleksandr Statciuk <free.arhey@gmail.com> Co-authored-by: iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>
This commit is contained in:
parent
df7907497b
commit
3e2bddab82
28 changed files with 255 additions and 202 deletions
|
@ -11,17 +11,21 @@ module.exports = class Playlist {
|
|||
this.updated = false
|
||||
}
|
||||
|
||||
toString(options = {}) {
|
||||
const config = { raw: false, ...options }
|
||||
let parts = ['#EXTM3U']
|
||||
getHeader() {
|
||||
let header = ['#EXTM3U']
|
||||
for (let key in this.header.attrs) {
|
||||
let value = this.header.attrs[key]
|
||||
if (value) {
|
||||
parts.push(`${key}="${value}"`)
|
||||
header.push(`${key}="${value}"`)
|
||||
}
|
||||
}
|
||||
|
||||
let output = `${parts.join(' ')}\n`
|
||||
return header.join(' ')
|
||||
}
|
||||
|
||||
toString(options = {}) {
|
||||
const config = { raw: false, ...options }
|
||||
let output = `${this.getHeader()}\n`
|
||||
for (let channel of this.channels) {
|
||||
output += channel.toString(config.raw)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue