mirror of
https://github.com/iptv-org/iptv
synced 2026-10-21 18:46:20 -04:00
Update scripts
This commit is contained in:
1 parent
1decbe7ac0
commit
94f473f7ca
98 files changed
+2423
-1499
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { Collection } from '../core'
|
||||
import { Stream } from '../models'
|
||||
|
||||
type PlaylistOptions = {
|
||||
public: boolean
|
||||
}
|
||||
|
||||
export class Playlist {
|
||||
streams: Collection
|
||||
options: {
|
||||
public: boolean
|
||||
}
|
||||
|
||||
constructor(streams: Collection, options?: PlaylistOptions) {
|
||||
this.streams = streams
|
||||
this.options = options || { public: false }
|
||||
}
|
||||
|
||||
toString() {
|
||||
let output = `#EXTM3U\n`
|
||||
|
||||
this.streams.forEach((stream: Stream) => {
|
||||
output += stream.toString(this.options) + `\n`
|
||||
})
|
||||
|
||||
return output
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user