mirror of
https://github.com/iptv-org/iptv
synced 2026-11-04 00:04:36 -05:00
Update generate-playlist.js
This commit is contained in:
1 parent
d3774679bd
commit
e3e4441909
65 files changed
+246
-156
No files matched your search
@@ -2,7 +2,7 @@ const api = require('../core/api')
|
||||
const _ = require('lodash')
|
||||
|
||||
module.exports = async function (streams = []) {
|
||||
streams = _.filter(streams, stream => !stream.channel || stream.channel.is_nsfw === false)
|
||||
streams = _.filter(streams, stream => stream.is_nsfw === false)
|
||||
|
||||
await api.countries.load()
|
||||
const countries = await api.countries.all()
|
||||
@@ -15,15 +15,15 @@ module.exports = async function (streams = []) {
|
||||
r => `r/${r.code}`
|
||||
)
|
||||
countryAreaCodes.push(`c/${country.code}`)
|
||||
let items = _.filter(
|
||||
streams,
|
||||
stream =>
|
||||
stream.channel && _.intersection(stream.channel.broadcast_area, countryAreaCodes).length
|
||||
)
|
||||
|
||||
let items = _.filter(streams, stream => {
|
||||
return _.intersection(stream.broadcast_area, countryAreaCodes).length
|
||||
})
|
||||
|
||||
output.push({ filepath: `countries/${country.code.toLowerCase()}.m3u`, items })
|
||||
}
|
||||
|
||||
let items = _.filter(streams, stream => !stream.channel || !stream.channel.broadcast_area.length)
|
||||
let items = _.filter(streams, stream => !stream.broadcast_area.length)
|
||||
output.push({ filepath: 'countries/undefined.m3u', items })
|
||||
|
||||
return output
|
||||
|
||||
Reference in new issue
Block a user