mirror of
https://github.com/iptv-org/iptv
synced 2026-10-22 02:56:48 -04:00
Update scripts
This commit is contained in:
1 parent
9902121ac0
commit
9d7cac7bda
21 files changed
+129
-55
No files matched your search
@@ -25,7 +25,7 @@ export class CategoriesGenerator implements Generator {
|
||||
}
|
||||
|
||||
async generate() {
|
||||
const streams = this.streams.sortBy([(stream: Stream) => stream.title])
|
||||
const streams = this.streams
|
||||
|
||||
this.categories.forEach(async (category: sdk.Models.Category) => {
|
||||
const categoryStreams = streams
|
||||
@@ -41,7 +41,7 @@ export class CategoriesGenerator implements Generator {
|
||||
return stream
|
||||
})
|
||||
|
||||
const playlist = new Playlist(categoryStreams, { public: true })
|
||||
const playlist = new Playlist(categoryStreams, { public: true, raw: false })
|
||||
const filepath = `categories/${category.id}.m3u`
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
@@ -50,7 +50,7 @@ export class CategoriesGenerator implements Generator {
|
||||
})
|
||||
|
||||
const undefinedStreams = streams.filter((stream: Stream) => stream.getCategories().isEmpty())
|
||||
const playlist = new Playlist(undefinedStreams, { public: true })
|
||||
const playlist = new Playlist(undefinedStreams, { public: true, raw: false })
|
||||
const filepath = 'categories/undefined.m3u'
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
|
||||
@@ -25,9 +25,7 @@ export class CitiesGenerator implements Generator {
|
||||
}
|
||||
|
||||
async generate(): Promise<void> {
|
||||
const streams = this.streams
|
||||
.sortBy((stream: Stream) => stream.title)
|
||||
.filter((stream: Stream) => stream.isSFW())
|
||||
const streams = this.streams.filter((stream: Stream) => stream.isSFW())
|
||||
|
||||
const streamsGroupedByCityCode = {}
|
||||
streams.forEach((stream: Stream) => {
|
||||
@@ -43,7 +41,7 @@ export class CitiesGenerator implements Generator {
|
||||
for (const cityCode in streamsGroupedByCityCode) {
|
||||
const cityStreams = streamsGroupedByCityCode[cityCode]
|
||||
|
||||
const playlist = new Playlist(cityStreams, { public: true })
|
||||
const playlist = new Playlist(cityStreams, { public: true, raw: false })
|
||||
const filepath = `cities/${cityCode.toLowerCase()}.m3u`
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
|
||||
@@ -25,9 +25,7 @@ export class CountriesGenerator implements Generator {
|
||||
}
|
||||
|
||||
async generate(): Promise<void> {
|
||||
const streams = this.streams
|
||||
.sortBy((stream: Stream) => stream.title)
|
||||
.filter((stream: Stream) => stream.isSFW())
|
||||
const streams = this.streams.filter((stream: Stream) => stream.isSFW())
|
||||
|
||||
const streamsGroupedByCountryCode = {}
|
||||
streams.forEach((stream: Stream) => {
|
||||
@@ -43,7 +41,7 @@ export class CountriesGenerator implements Generator {
|
||||
for (const countryCode in streamsGroupedByCountryCode) {
|
||||
const countryStreams = streamsGroupedByCountryCode[countryCode]
|
||||
|
||||
const playlist = new Playlist(countryStreams, { public: true })
|
||||
const playlist = new Playlist(countryStreams, { public: true, raw: false })
|
||||
const filepath = `countries/${countryCode.toLowerCase()}.m3u`
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
@@ -52,7 +50,10 @@ export class CountriesGenerator implements Generator {
|
||||
}
|
||||
|
||||
const internationalStreams = streams.filter((stream: Stream) => stream.isInternational())
|
||||
const internationalPlaylist = new Playlist(internationalStreams, { public: true })
|
||||
const internationalPlaylist = new Playlist(internationalStreams, {
|
||||
public: true,
|
||||
displayUniqueName: true
|
||||
})
|
||||
const internationalFilepath = 'countries/int.m3u'
|
||||
await this.storage.save(internationalFilepath, internationalPlaylist.toString())
|
||||
this.logFile.append(
|
||||
@@ -66,7 +67,7 @@ export class CountriesGenerator implements Generator {
|
||||
const undefinedStreams = streams.filter((stream: Stream) =>
|
||||
stream.getBroadcastAreaCodes().isEmpty()
|
||||
)
|
||||
const undefinedPlaylist = new Playlist(undefinedStreams, { public: true })
|
||||
const undefinedPlaylist = new Playlist(undefinedStreams, { public: true, raw: false })
|
||||
const undefinedFilepath = 'countries/undefined.m3u'
|
||||
await this.storage.save(undefinedFilepath, undefinedPlaylist.toString())
|
||||
this.logFile.append(
|
||||
|
||||
@@ -22,7 +22,7 @@ export class IndexCategoryGenerator implements Generator {
|
||||
}
|
||||
|
||||
async generate(): Promise<void> {
|
||||
const streams = this.streams.sortBy(stream => stream.title).filter(stream => stream.isSFW())
|
||||
const streams = this.streams.filter(stream => stream.isSFW())
|
||||
|
||||
let groupedStreams = new Collection<Stream>()
|
||||
streams.forEach((stream: Stream) => {
|
||||
@@ -46,7 +46,7 @@ export class IndexCategoryGenerator implements Generator {
|
||||
return stream.groupTitle
|
||||
})
|
||||
|
||||
const playlist = new Playlist(groupedStreams, { public: true })
|
||||
const playlist = new Playlist(groupedStreams, { public: true, raw: false })
|
||||
const filepath = 'index.category.m3u'
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
|
||||
@@ -25,7 +25,6 @@ export class IndexCountryGenerator implements Generator {
|
||||
let groupedStreams = new Collection<Stream>()
|
||||
|
||||
this.streams
|
||||
.sortBy((stream: Stream) => stream.title)
|
||||
.filter((stream: Stream) => stream.isSFW())
|
||||
.forEach((stream: Stream) => {
|
||||
const broadcastAreaCountries = stream.getBroadcastCountries()
|
||||
@@ -57,7 +56,7 @@ export class IndexCountryGenerator implements Generator {
|
||||
return stream.groupTitle
|
||||
})
|
||||
|
||||
const playlist = new Playlist(groupedStreams, { public: true })
|
||||
const playlist = new Playlist(groupedStreams, { public: true, raw: false })
|
||||
const filepath = 'index.country.m3u'
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
|
||||
@@ -22,7 +22,6 @@ export class IndexGenerator implements Generator {
|
||||
|
||||
async generate(): Promise<void> {
|
||||
const sfwStreams = this.streams
|
||||
.sortBy(stream => stream.title)
|
||||
.filter((stream: Stream) => stream.isSFW())
|
||||
.map((stream: Stream) => {
|
||||
const groupTitle = stream
|
||||
@@ -35,7 +34,7 @@ export class IndexGenerator implements Generator {
|
||||
return stream
|
||||
})
|
||||
|
||||
const playlist = new Playlist(sfwStreams, { public: true })
|
||||
const playlist = new Playlist(sfwStreams, { public: true, raw: false })
|
||||
const filepath = 'index.m3u'
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
|
||||
@@ -24,7 +24,6 @@ export class IndexLanguageGenerator implements Generator {
|
||||
async generate(): Promise<void> {
|
||||
let groupedStreams = new Collection<Stream>()
|
||||
this.streams
|
||||
.sortBy((stream: Stream) => stream.title)
|
||||
.filter((stream: Stream) => stream.isSFW())
|
||||
.forEach((stream: Stream) => {
|
||||
const streamLanguages = stream.getLanguages()
|
||||
@@ -47,7 +46,7 @@ export class IndexLanguageGenerator implements Generator {
|
||||
return stream.groupTitle
|
||||
})
|
||||
|
||||
const playlist = new Playlist(groupedStreams, { public: true })
|
||||
const playlist = new Playlist(groupedStreams, { public: true, raw: false })
|
||||
const filepath = 'index.language.m3u'
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
|
||||
@@ -19,9 +19,7 @@ export class LanguagesGenerator implements Generator {
|
||||
}
|
||||
|
||||
async generate(): Promise<void> {
|
||||
const streams: Collection<Stream> = this.streams
|
||||
.sortBy((stream: Stream) => stream.title)
|
||||
.filter((stream: Stream) => stream.isSFW())
|
||||
const streams: Collection<Stream> = this.streams.filter((stream: Stream) => stream.isSFW())
|
||||
|
||||
const languages = new Collection<sdk.Models.Language>()
|
||||
streams.forEach((stream: Stream) => {
|
||||
@@ -39,7 +37,7 @@ export class LanguagesGenerator implements Generator {
|
||||
|
||||
if (languageStreams.isEmpty()) return
|
||||
|
||||
const playlist = new Playlist(languageStreams, { public: true })
|
||||
const playlist = new Playlist(languageStreams, { public: true, raw: false })
|
||||
const filepath = `languages/${language.code}.m3u`
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
@@ -50,7 +48,7 @@ export class LanguagesGenerator implements Generator {
|
||||
const undefinedStreams = streams.filter((stream: Stream) => stream.getLanguages().isEmpty())
|
||||
if (undefinedStreams.isEmpty()) return
|
||||
|
||||
const playlist = new Playlist(undefinedStreams, { public: true })
|
||||
const playlist = new Playlist(undefinedStreams, { public: true, raw: false })
|
||||
const filepath = 'languages/undefined.m3u'
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
|
||||
@@ -34,7 +34,7 @@ export class RawGenerator implements Generator {
|
||||
|
||||
return stream
|
||||
})
|
||||
const playlist = new Playlist(streams, { public: true })
|
||||
const playlist = new Playlist(streams, { public: true, raw: true })
|
||||
const filepath = `raw/${filename}`
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
|
||||
@@ -25,9 +25,7 @@ export class RegionsGenerator implements Generator {
|
||||
}
|
||||
|
||||
async generate(): Promise<void> {
|
||||
const streams = this.streams
|
||||
.sortBy((stream: Stream) => stream.title)
|
||||
.filter((stream: Stream) => stream.isSFW())
|
||||
const streams = this.streams.filter((stream: Stream) => stream.isSFW())
|
||||
|
||||
const streamsGroupedByRegionCode = {}
|
||||
streams.forEach((stream: Stream) => {
|
||||
@@ -43,7 +41,7 @@ export class RegionsGenerator implements Generator {
|
||||
for (const regionCode in streamsGroupedByRegionCode) {
|
||||
const regionStreams = streamsGroupedByRegionCode[regionCode]
|
||||
|
||||
const playlist = new Playlist(regionStreams, { public: true })
|
||||
const playlist = new Playlist(regionStreams, { public: true, raw: false })
|
||||
const filepath = `regions/${regionCode.toLowerCase()}.m3u`
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
|
||||
@@ -38,7 +38,7 @@ export class SourcesGenerator implements Generator {
|
||||
|
||||
return stream
|
||||
})
|
||||
const playlist = new Playlist(streams, { public: true })
|
||||
const playlist = new Playlist(streams, { public: true, raw: false })
|
||||
const filepath = `sources/${filename}`
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
|
||||
@@ -25,9 +25,7 @@ export class SubdivisionsGenerator implements Generator {
|
||||
}
|
||||
|
||||
async generate(): Promise<void> {
|
||||
const streams = this.streams
|
||||
.sortBy((stream: Stream) => stream.title)
|
||||
.filter((stream: Stream) => stream.isSFW())
|
||||
const streams = this.streams.filter((stream: Stream) => stream.isSFW())
|
||||
|
||||
const streamsGroupedBySubdivisionCode = {}
|
||||
streams.forEach((stream: Stream) => {
|
||||
@@ -43,7 +41,7 @@ export class SubdivisionsGenerator implements Generator {
|
||||
for (const subdivisionCode in streamsGroupedBySubdivisionCode) {
|
||||
const subdivisionStreams = streamsGroupedBySubdivisionCode[subdivisionCode]
|
||||
|
||||
const playlist = new Playlist(subdivisionStreams, { public: true })
|
||||
const playlist = new Playlist(subdivisionStreams, { public: true, raw: false })
|
||||
const filepath = `subdivisions/${subdivisionCode.toLowerCase()}.m3u`
|
||||
await this.storage.save(filepath, playlist.toString())
|
||||
this.logFile.append(
|
||||
|
||||
Reference in new issue
Block a user