Update scripts

This commit is contained in:
freearhey 2023-11-01 05:38:07 +03:00
parent e0a2cb295a
commit 62fac80172
6 changed files with 27 additions and 5 deletions

View file

@ -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}"`
}