mirror of
https://github.com/iptv-org/iptv
synced 2025-12-16 10:26:48 -05:00
Update scripts
This commit is contained in:
@@ -40,5 +40,17 @@ export class CountriesGenerator implements Generator {
|
|||||||
JSON.stringify({ type: 'country', filepath, count: playlist.streams.count() }) + EOL
|
JSON.stringify({ type: 'country', filepath, count: playlist.streams.count() }) + EOL
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const undefinedStreams = streams.filter((stream: Stream) => !stream.hasBroadcastArea())
|
||||||
|
const undefinedPlaylist = new Playlist(undefinedStreams, { public: true })
|
||||||
|
const undefinedFilepath = 'countries/undefined.m3u'
|
||||||
|
await this.storage.save(undefinedFilepath, undefinedPlaylist.toString())
|
||||||
|
this.logFile.append(
|
||||||
|
JSON.stringify({
|
||||||
|
type: 'country',
|
||||||
|
filepath: undefinedFilepath,
|
||||||
|
count: undefinedPlaylist.streams.count()
|
||||||
|
}) + EOL
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,12 @@ export class IndexCountryGenerator implements Generator {
|
|||||||
.orderBy((stream: Stream) => stream.getTitle())
|
.orderBy((stream: Stream) => stream.getTitle())
|
||||||
.filter((stream: Stream) => stream.isSFW())
|
.filter((stream: Stream) => stream.isSFW())
|
||||||
.forEach((stream: Stream) => {
|
.forEach((stream: Stream) => {
|
||||||
if (!stream.hasBroadcastArea()) return
|
if (!stream.hasBroadcastArea()) {
|
||||||
|
const streamClone = stream.clone()
|
||||||
|
streamClone.groupTitle = 'Undefined'
|
||||||
|
groupedStreams.add(streamClone)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
stream.getBroadcastCountries().forEach((country: Country) => {
|
stream.getBroadcastCountries().forEach((country: Country) => {
|
||||||
const streamClone = stream.clone()
|
const streamClone = stream.clone()
|
||||||
@@ -35,7 +40,11 @@ export class IndexCountryGenerator implements Generator {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
groupedStreams = groupedStreams.orderBy((stream: Stream) => stream.groupTitle)
|
groupedStreams = groupedStreams.orderBy((stream: Stream) => {
|
||||||
|
if (stream.groupTitle === 'Undefined') return 'ZZZ'
|
||||||
|
|
||||||
|
return stream.groupTitle
|
||||||
|
})
|
||||||
|
|
||||||
const playlist = new Playlist(groupedStreams, { public: true })
|
const playlist = new Playlist(groupedStreams, { public: true })
|
||||||
const filepath = 'index.country.m3u'
|
const filepath = 'index.country.m3u'
|
||||||
|
|||||||
Reference in New Issue
Block a user