mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-12 18:10:04 -04:00
Update scripts
This commit is contained in:
parent
b628341520
commit
1b29e05111
6 changed files with 3 additions and 18 deletions
|
@ -13,7 +13,7 @@ async function main() {
|
|||
let streams = await parser.parse(files)
|
||||
streams = streams
|
||||
.map(data => new Stream(data))
|
||||
.orderBy([(stream: Stream) => stream.channel, (stream: Stream) => stream.timeshift])
|
||||
.orderBy([(stream: Stream) => stream.channel])
|
||||
.map((stream: Stream) => stream.toJSON())
|
||||
|
||||
logger.info(`found ${streams.count()} streams`)
|
||||
|
|
|
@ -105,7 +105,6 @@ async function loadStreams({
|
|||
.orderBy(
|
||||
[
|
||||
(stream: Stream) => stream.channel,
|
||||
(stream: Stream) => stream.timeshift,
|
||||
(stream: Stream) => parseInt(stream.quality.replace('p', '')),
|
||||
(stream: Stream) => stream.label
|
||||
],
|
||||
|
|
|
@ -105,7 +105,6 @@ async function editStreams(loader: IssueLoader) {
|
|||
|
||||
if (data.has('label')) stream.label = data.getString('label')
|
||||
if (data.has('quality')) stream.quality = data.getString('quality')
|
||||
if (data.has('timeshift')) stream.timeshift = data.getString('timeshift')
|
||||
if (data.has('user_agent')) stream.userAgent = data.getString('user_agent')
|
||||
if (data.has('http_referrer')) stream.httpReferrer = data.getString('http_referrer')
|
||||
|
||||
|
@ -132,7 +131,6 @@ async function addStreams(loader: IssueLoader) {
|
|||
url: data.getString('stream_url'),
|
||||
label: data.getString('label'),
|
||||
quality: data.getString('quality'),
|
||||
timeshift: data.getString('timeshift'),
|
||||
userAgent: data.getString('user_agent'),
|
||||
httpReferrer: data.getString('http_referrer'),
|
||||
filepath: `${channel.country.toLowerCase()}.m3u`,
|
||||
|
|
|
@ -12,8 +12,6 @@ const FIELDS = new Dictionary({
|
|||
'Broken Links': 'broken_links',
|
||||
Label: 'label',
|
||||
Quality: 'quality',
|
||||
Timeshift: 'timeshift',
|
||||
'Timeshift (optional)': 'timeshift',
|
||||
'Channel Name': 'channel_name',
|
||||
'HTTP User-Agent': 'user_agent',
|
||||
'HTTP Referrer': 'http_referrer',
|
||||
|
|
|
@ -40,8 +40,7 @@ export class PlaylistParser {
|
|||
line: item.line,
|
||||
url: item.url,
|
||||
httpReferrer: item.http.referrer,
|
||||
userAgent: item.http['user-agent'],
|
||||
timeshift: item.tvg.shift
|
||||
userAgent: item.http['user-agent']
|
||||
})
|
||||
|
||||
streams.add(stream)
|
||||
|
|
|
@ -11,7 +11,6 @@ type StreamProps = {
|
|||
label?: string
|
||||
quality?: string
|
||||
userAgent?: string
|
||||
timeshift?: string
|
||||
}
|
||||
|
||||
export class Stream {
|
||||
|
@ -31,7 +30,6 @@ export class Stream {
|
|||
isNSFW: boolean
|
||||
groupTitle: string
|
||||
removed: boolean = false
|
||||
timeshift: string
|
||||
|
||||
constructor({
|
||||
channel,
|
||||
|
@ -42,8 +40,7 @@ export class Stream {
|
|||
name,
|
||||
quality,
|
||||
url,
|
||||
userAgent,
|
||||
timeshift
|
||||
userAgent
|
||||
}: StreamProps) {
|
||||
this.channel = channel || ''
|
||||
this.filepath = filepath
|
||||
|
@ -60,7 +57,6 @@ export class Stream {
|
|||
this.languages = new Collection()
|
||||
this.isNSFW = false
|
||||
this.groupTitle = 'Undefined'
|
||||
this.timeshift = timeshift || ''
|
||||
}
|
||||
|
||||
normalizeURL() {
|
||||
|
@ -149,7 +145,6 @@ export class Stream {
|
|||
return {
|
||||
channel: this.channel || null,
|
||||
url: this.url,
|
||||
timeshift: this.timeshift || null,
|
||||
http_referrer: this.httpReferrer || null,
|
||||
user_agent: this.userAgent || null
|
||||
}
|
||||
|
@ -158,10 +153,6 @@ 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