Update scripts

This commit is contained in:
freearhey
2025-03-09 19:53:25 +03:00
parent 169e72c9d6
commit 94a326e15b
5 changed files with 51 additions and 47 deletions

View File

@@ -8,9 +8,9 @@ type StreamProps = {
line: number
channel?: string
httpReferrer?: string
httpUserAgent?: string
label?: string
quality?: string
userAgent?: string
}
export class Stream {
@@ -22,7 +22,7 @@ export class Stream {
name: string
quality: string
url: string
userAgent: string
httpUserAgent: string
logo: string
broadcastArea: Collection
categories: Collection
@@ -40,7 +40,7 @@ export class Stream {
name,
quality,
url,
userAgent
httpUserAgent
}: StreamProps) {
this.channel = channel || ''
this.filepath = filepath
@@ -50,7 +50,7 @@ export class Stream {
this.name = name
this.quality = quality || ''
this.url = url
this.userAgent = userAgent || ''
this.httpUserAgent = httpUserAgent || ''
this.logo = ''
this.broadcastArea = new Collection()
this.categories = new Collection()
@@ -136,7 +136,7 @@ export class Stream {
name: this.name,
quality: this.quality,
url: this.url,
userAgent: this.userAgent,
httpUserAgent: this.httpUserAgent,
line: this.line
}
}
@@ -145,8 +145,8 @@ export class Stream {
return {
channel: this.channel || null,
url: this.url,
http_referrer: this.httpReferrer || null,
user_agent: this.userAgent || null
referrer: this.httpReferrer || null,
user_agent: this.httpUserAgent || null
}
}
@@ -157,8 +157,12 @@ export class Stream {
output += ` tvg-logo="${this.logo}" group-title="${this.groupTitle}"`
}
if (this.userAgent) {
output += ` user-agent="${this.userAgent}"`
if (this.httpReferrer) {
output += ` http-referrer="${this.httpReferrer}"`
}
if (this.httpUserAgent) {
output += ` http-user-agent="${this.httpUserAgent}"`
}
output += `,${this.getTitle()}`
@@ -167,8 +171,8 @@ export class Stream {
output += `\n#EXTVLCOPT:http-referrer=${this.httpReferrer}`
}
if (this.userAgent) {
output += `\n#EXTVLCOPT:http-user-agent=${this.userAgent}`
if (this.httpUserAgent) {
output += `\n#EXTVLCOPT:http-user-agent=${this.httpUserAgent}`
}
output += `\n${this.url}`