MCPcopy
hub / github.com/iptv-org/iptv / toString

Method toString

scripts/models/stream.ts:417–449  ·  view source on GitHub ↗
(options: { public?: boolean } = {})

Source from the content-addressed store, hash-verified

415 }
416
417 toString(options: { public?: boolean } = {}) {
418 options = { ...{ public: false }, ...options }
419
420 let output = `#EXTINF:-1 tvg-id="${this.getTvgId()}"`
421
422 if (options.public) {
423 output += ` tvg-logo="${this.getTvgLogo()}"`
424
425 if (this.referrer) {
426 output += ` http-referrer="${this.referrer}"`
427 }
428
429 if (this.user_agent) {
430 output += ` http-user-agent="${this.user_agent}"`
431 }
432
433 output += ` group-title="${this.groupTitle}"`
434 }
435
436 output += `,${this.getFullTitle()}`
437
438 if (this.referrer) {
439 output += `\r\n#EXTVLCOPT:http-referrer=${this.referrer}`
440 }
441
442 if (this.user_agent) {
443 output += `\r\n#EXTVLCOPT:http-user-agent=${this.user_agent}`
444 }
445
446 output += `\r\n${this.url}`
447
448 return output
449 }
450
451 toObject(): sdk.Types.StreamData {
452 let feedId = this.feed

Callers 7

normalizeURLFunction · 0.45
createMethod · 0.45
createMethod · 0.45
format.test.tsFile · 0.45
update.test.tsFile · 0.45
test.test.tsFile · 0.45
generate.test.tsFile · 0.45

Calls 3

getTvgIdMethod · 0.95
getTvgLogoMethod · 0.95
getFullTitleMethod · 0.95

Tested by

no test coverage detected