mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-12 01:50:04 -04:00
Update scripts
This commit is contained in:
parent
e0a2cb295a
commit
62fac80172
6 changed files with 27 additions and 5 deletions
|
@ -11,6 +11,7 @@ type StreamProps = {
|
|||
label?: string
|
||||
quality?: string
|
||||
userAgent?: string
|
||||
timeshift?: string
|
||||
}
|
||||
|
||||
export class Stream {
|
||||
|
@ -30,6 +31,7 @@ export class Stream {
|
|||
isNSFW: boolean
|
||||
groupTitle: string
|
||||
removed: boolean = false
|
||||
timeshift: string
|
||||
|
||||
constructor({
|
||||
channel,
|
||||
|
@ -40,7 +42,8 @@ export class Stream {
|
|||
name,
|
||||
quality,
|
||||
url,
|
||||
userAgent
|
||||
userAgent,
|
||||
timeshift
|
||||
}: StreamProps) {
|
||||
this.channel = channel || ''
|
||||
this.filepath = filepath
|
||||
|
@ -57,6 +60,7 @@ export class Stream {
|
|||
this.languages = new Collection()
|
||||
this.isNSFW = false
|
||||
this.groupTitle = 'Undefined'
|
||||
this.timeshift = timeshift || ''
|
||||
}
|
||||
|
||||
normalizeURL() {
|
||||
|
@ -145,6 +149,7 @@ export class Stream {
|
|||
return {
|
||||
channel: this.channel,
|
||||
url: this.url,
|
||||
timeshift: this.timeshift || null,
|
||||
http_referrer: this.httpReferrer || null,
|
||||
user_agent: this.userAgent || null
|
||||
}
|
||||
|
@ -153,6 +158,10 @@ export class Stream {
|
|||
toString(options: { public: boolean }) {
|
||||
let output = `#EXTINF:-1 tvg-id="${this.channel}"`
|
||||
|
||||
if (this.timeshift) {
|
||||
output += ` tvg-shift="${this.timeshift}"`
|
||||
}
|
||||
|
||||
if (options.public) {
|
||||
output += ` tvg-logo="${this.logo}" group-title="${this.groupTitle}"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue