Merge pull request #5918 from iptv-org/fix-channels-json
Update generate-playlists.js
This commit is contained in:
commit
a884bfd084
|
@ -178,7 +178,31 @@ async function generateIndexCategory() {
|
||||||
await generator.generate(
|
await generator.generate(
|
||||||
`${PUBLIC_PATH}/index.category.m3u`,
|
`${PUBLIC_PATH}/index.category.m3u`,
|
||||||
{},
|
{},
|
||||||
{ sortBy: item => item.group_title }
|
{
|
||||||
|
onLoad: function (items) {
|
||||||
|
let results = items
|
||||||
|
.filter(item => !item.categories || !item.categories.length)
|
||||||
|
.map(item => {
|
||||||
|
const newItem = _.cloneDeep(item)
|
||||||
|
newItem.group_title = ''
|
||||||
|
return newItem
|
||||||
|
})
|
||||||
|
for (const category of _.sortBy(Object.values(categories), ['name'])) {
|
||||||
|
let filtered = items
|
||||||
|
.filter(item => {
|
||||||
|
return Array.isArray(item.categories) && item.categories.map(c => c.slug).includes(category.slug)
|
||||||
|
})
|
||||||
|
.map(item => {
|
||||||
|
const newItem = _.cloneDeep(item)
|
||||||
|
newItem.group_title = category.name
|
||||||
|
return newItem
|
||||||
|
})
|
||||||
|
results = results.concat(filtered)
|
||||||
|
}
|
||||||
|
|
||||||
|
return results
|
||||||
|
},
|
||||||
|
sortBy: item => item.group_title }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +215,7 @@ async function generateIndexCountry() {
|
||||||
{
|
{
|
||||||
onLoad: function (items) {
|
onLoad: function (items) {
|
||||||
let results = items
|
let results = items
|
||||||
.filter(item => !item.countries.length)
|
.filter(item => !item.countries || !item.countries.length)
|
||||||
.map(item => {
|
.map(item => {
|
||||||
const newItem = _.cloneDeep(item)
|
const newItem = _.cloneDeep(item)
|
||||||
newItem.group_title = ''
|
newItem.group_title = ''
|
||||||
|
@ -200,7 +224,7 @@ async function generateIndexCountry() {
|
||||||
for (const country of _.sortBy(Object.values(countries), ['name'])) {
|
for (const country of _.sortBy(Object.values(countries), ['name'])) {
|
||||||
let filtered = items
|
let filtered = items
|
||||||
.filter(item => {
|
.filter(item => {
|
||||||
return item.countries.map(c => c.code).includes(country.code)
|
return Array.isArray(item.countries) && item.countries.map(c => c.code).includes(country.code)
|
||||||
})
|
})
|
||||||
.map(item => {
|
.map(item => {
|
||||||
const newItem = _.cloneDeep(item)
|
const newItem = _.cloneDeep(item)
|
||||||
|
@ -226,7 +250,7 @@ async function generateIndexLanguage() {
|
||||||
{
|
{
|
||||||
onLoad: function (items) {
|
onLoad: function (items) {
|
||||||
let results = items
|
let results = items
|
||||||
.filter(item => !item.languages.length)
|
.filter(item => !item.languages || !item.languages.length)
|
||||||
.map(item => {
|
.map(item => {
|
||||||
const newItem = _.cloneDeep(item)
|
const newItem = _.cloneDeep(item)
|
||||||
newItem.group_title = ''
|
newItem.group_title = ''
|
||||||
|
@ -235,7 +259,7 @@ async function generateIndexLanguage() {
|
||||||
for (const language of languages) {
|
for (const language of languages) {
|
||||||
let filtered = items
|
let filtered = items
|
||||||
.filter(item => {
|
.filter(item => {
|
||||||
return item.languages.map(c => c.code).includes(language.code)
|
return Array.isArray(item.languages) && item.languages.map(c => c.code).includes(language.code)
|
||||||
})
|
})
|
||||||
.map(item => {
|
.map(item => {
|
||||||
const newItem = _.cloneDeep(item)
|
const newItem = _.cloneDeep(item)
|
||||||
|
@ -290,16 +314,16 @@ async function generateIndexRegion() {
|
||||||
async function generateChannelsJson() {
|
async function generateChannelsJson() {
|
||||||
logger.info('Generating channels.json...')
|
logger.info('Generating channels.json...')
|
||||||
|
|
||||||
await generator.generate(`${PUBLIC_PATH}/channels.json`, {}, { format: 'json' })
|
await generator.generate(`${PUBLIC_PATH}/channels.json`, {}, { format: 'json', includeNSFW: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setUp() {
|
async function setUp() {
|
||||||
logger.info(`Loading database...`)
|
logger.info(`Loading database...`)
|
||||||
const items = await db.find({})
|
const items = await db.find({})
|
||||||
categories = _.sortBy(_.uniqBy(_.flatten(items.map(i => i.categories)), 'slug'), ['name'])
|
categories = _.sortBy(_.uniqBy(_.flatten(items.map(i => i.categories)), 'slug'), ['name']).filter(i => i)
|
||||||
countries = _.sortBy(_.uniqBy(_.flatten(items.map(i => i.countries)), 'code'), ['name'])
|
countries = _.sortBy(_.uniqBy(_.flatten(items.map(i => i.countries)), 'code'), ['name']).filter(i => i)
|
||||||
languages = _.sortBy(_.uniqBy(_.flatten(items.map(i => i.languages)), 'code'), ['name'])
|
languages = _.sortBy(_.uniqBy(_.flatten(items.map(i => i.languages)), 'code'), ['name']).filter(i => i)
|
||||||
regions = _.sortBy(_.uniqBy(_.flatten(items.map(i => i.regions)), 'code'), ['name'])
|
regions = _.sortBy(_.uniqBy(_.flatten(items.map(i => i.regions)), 'code'), ['name']).filter(i => i)
|
||||||
|
|
||||||
const categoriesLog = `${LOGS_PATH}/generate-playlists/categories.log`
|
const categoriesLog = `${LOGS_PATH}/generate-playlists/categories.log`
|
||||||
const countriesLog = `${LOGS_PATH}/generate-playlists/countries.log`
|
const countriesLog = `${LOGS_PATH}/generate-playlists/countries.log`
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{"name":"ЛДПР ТВ","id":"LDPRTV.ru","filepath":"tests/__data__/output/channels/ru.m3u","src_country":{"name":"Russia","code":"RU","lang":"rus"},"tvg_country":"RU","countries":[{"name":"Russia","code":"RU","lang":"rus"}],"regions":[{"name":"Asia","code":"ASIA"},{"name":"Commonwealth of Independent States","code":"CIS"},{"name":"Europe, the Middle East and Africa","code":"EMEA"},{"name":"Europe","code":"EUR"}],"languages":[{"name":"Russian","code":"rus"}],"categories":[{"name":"General","slug":"general","nsfw":false},{"name":"Legislative","slug":"legislative","nsfw":false}],"tvg_url":"","guides":["https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"],"logo":"https://iptvx.one/icn/ldpr-tv.png","resolution":{"height":1080,"width":null},"status":{"label":"","code":"online","level":1},"url":"http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8","http":{"referrer":"","user-agent":""},"is_nsfw":false,"is_broken":false,"updated":false,"cluster_id":1,"_id":"2ST8btby3mmsgPF0"}
|
||||||
|
{"name":"BBC News HD","id":"BBCNews.uk","filepath":"tests/__data__/output/channels/uk.m3u","src_country":{"name":"United Kingdom","code":"UK","lang":"eng"},"tvg_country":"UK","countries":[{"name":"United Kingdom","code":"UK","lang":"eng"}],"regions":[{"name":"Europe, the Middle East and Africa","code":"EMEA"},{"name":"Europe","code":"EUR"}],"languages":[{"name":"English","code":"eng"}],"categories":[{"name":"News","slug":"news","nsfw":false}],"tvg_url":"","guides":[],"logo":"https://i.imgur.com/eNPIQ9f.png","resolution":{"height":720,"width":null},"status":{"label":"Not 24/7","code":"not_247","level":3},"url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http":{"referrer":"","user-agent":""},"is_nsfw":false,"is_broken":false,"updated":false,"cluster_id":3,"_id":"3TbieV1ptnZVCIdn"}
|
||||||
|
{"name":"ATV","id":"AndorraTV.ad","filepath":"tests/__data__/output/channels/ad.m3u","src_country":{"name":"Andorra","code":"AD","lang":"cat"},"tvg_country":"AD","countries":[{"name":"Andorra","code":"AD","lang":"cat"}],"regions":[{"name":"Europe, the Middle East and Africa","code":"EMEA"},{"name":"Europe","code":"EUR"}],"languages":[{"name":"Catalan","code":"cat"}],"categories":[{"name":"General","slug":"general","nsfw":false}],"tvg_url":"","guides":[],"logo":"https://i.imgur.com/kJCjeQ4.png","resolution":{"height":720,"width":null},"status":{"label":"Offline","code":"offline","level":5},"url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http":{"referrer":"","user-agent":""},"is_nsfw":false,"is_broken":true,"updated":false,"cluster_id":1,"_id":"I6cjG2xCBRFFP4sz"}
|
||||||
|
{"name":"BBC News HD","id":"AndorraTV.ad","filepath":"tests/__data__/output/channels/uk.m3u","src_country":{"name":"United Kingdom","code":"UK","lang":"eng"},"tvg_country":"UK","countries":[{"name":"United Kingdom","code":"UK","lang":"eng"}],"regions":[{"name":"Europe, the Middle East and Africa","code":"EMEA"},{"name":"Europe","code":"EUR"}],"languages":[{"name":"English","code":"eng"}],"categories":[{"name":"News","slug":"news","nsfw":false}],"tvg_url":"","guides":[],"logo":"https://i.imgur.com/eNPIQ9f.png","resolution":{"height":720,"width":null},"status":{"label":"Not 24/7","code":"not_247","level":3},"url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http":{"referrer":"","user-agent":""},"is_nsfw":false,"is_broken":false,"updated":false,"cluster_id":3,"_id":"WTbieV1ptnZVCIdn"}
|
||||||
|
{"name":"Visit-X TV","id":"","filepath":"tests/__data__/output/channels/nl.m3u","src_country":{},"tvg_country":"","countries":[],"regions":[],"languages":[],"categories":[{"name":"XXX","slug":"xxx","nsfw":true}],"tvg_url":"","guides":[],"logo":"","resolution":{},"status":{"label":"","code":"online","level":1},"url":"https://stream.visit-x.tv/vxtv/ngrp:live_all/playlist.m3u8","http":{"referrer":"","user-agent":""},"is_nsfw":true,"is_broken":false,"updated":false,"cluster_id":1,"_id":"2ST8btby3mmsgPF5"}
|
|
@ -10,7 +10,7 @@ function content(filepath) {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fs.rmdirSync('tests/__data__/output', { recursive: true })
|
fs.rmdirSync('tests/__data__/output', { recursive: true })
|
||||||
fs.copyFileSync('tests/__data__/input/test.db', 'tests/__data__/temp/test.db')
|
fs.copyFileSync('tests/__data__/input/generate-playlists.test.db', 'tests/__data__/temp/test.db')
|
||||||
|
|
||||||
execSync(
|
execSync(
|
||||||
'DB_FILEPATH=tests/__data__/temp/test.db PUBLIC_PATH=tests/__data__/output/.gh-pages LOGS_PATH=tests/__data__/output/logs node scripts/commands/generate-playlists.js',
|
'DB_FILEPATH=tests/__data__/temp/test.db PUBLIC_PATH=tests/__data__/output/.gh-pages LOGS_PATH=tests/__data__/output/logs node scripts/commands/generate-playlists.js',
|
||||||
|
@ -26,7 +26,13 @@ afterEach(() => {
|
||||||
it('can generate categories', () => {
|
it('can generate categories', () => {
|
||||||
expect(content('.gh-pages/categories/general.m3u'))
|
expect(content('.gh-pages/categories/general.m3u'))
|
||||||
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
||||||
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General",ЛДПР ТВ (1080p)
|
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General;Legislative",ЛДПР ТВ (1080p)
|
||||||
|
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
|
`)
|
||||||
|
|
||||||
|
expect(content('.gh-pages/categories/legislative.m3u'))
|
||||||
|
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
||||||
|
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General;Legislative",ЛДПР ТВ (1080p)
|
||||||
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
`)
|
`)
|
||||||
|
|
||||||
|
@ -39,7 +45,7 @@ http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
||||||
it('can generate countries', () => {
|
it('can generate countries', () => {
|
||||||
expect(content('.gh-pages/countries/ru.m3u'))
|
expect(content('.gh-pages/countries/ru.m3u'))
|
||||||
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
||||||
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General",ЛДПР ТВ (1080p)
|
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General;Legislative",ЛДПР ТВ (1080p)
|
||||||
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
`)
|
`)
|
||||||
|
|
||||||
|
@ -52,7 +58,7 @@ http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
||||||
it('can generate languages', () => {
|
it('can generate languages', () => {
|
||||||
expect(content('.gh-pages/languages/rus.m3u'))
|
expect(content('.gh-pages/languages/rus.m3u'))
|
||||||
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
||||||
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General",ЛДПР ТВ (1080p)
|
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General;Legislative",ЛДПР ТВ (1080p)
|
||||||
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
`)
|
`)
|
||||||
|
|
||||||
|
@ -65,13 +71,13 @@ http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
||||||
it('can generate regions', () => {
|
it('can generate regions', () => {
|
||||||
expect(content('.gh-pages/regions/asia.m3u'))
|
expect(content('.gh-pages/regions/asia.m3u'))
|
||||||
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
||||||
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General",ЛДПР ТВ (1080p)
|
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General;Legislative",ЛДПР ТВ (1080p)
|
||||||
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
`)
|
`)
|
||||||
|
|
||||||
expect(content('.gh-pages/regions/cis.m3u'))
|
expect(content('.gh-pages/regions/cis.m3u'))
|
||||||
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
||||||
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General",ЛДПР ТВ (1080p)
|
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General;Legislative",ЛДПР ТВ (1080p)
|
||||||
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
`)
|
`)
|
||||||
|
|
||||||
|
@ -79,7 +85,7 @@ http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
||||||
#EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="UK" tvg-language="English" tvg-logo="https://i.imgur.com/eNPIQ9f.png" group-title="News",BBC News HD (720p) [Not 24/7]
|
#EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="UK" tvg-language="English" tvg-logo="https://i.imgur.com/eNPIQ9f.png" group-title="News",BBC News HD (720p) [Not 24/7]
|
||||||
http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
||||||
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General",ЛДПР ТВ (1080p)
|
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General;Legislative",ЛДПР ТВ (1080p)
|
||||||
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
`)
|
`)
|
||||||
|
|
||||||
|
@ -87,24 +93,26 @@ http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
||||||
#EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="UK" tvg-language="English" tvg-logo="https://i.imgur.com/eNPIQ9f.png" group-title="News",BBC News HD (720p) [Not 24/7]
|
#EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="UK" tvg-language="English" tvg-logo="https://i.imgur.com/eNPIQ9f.png" group-title="News",BBC News HD (720p) [Not 24/7]
|
||||||
http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
||||||
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General",ЛДПР ТВ (1080p)
|
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General;Legislative",ЛДПР ТВ (1080p)
|
||||||
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
`)
|
`)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can generate channels.json', () => {
|
it('can generate channels.json', () => {
|
||||||
expect(content('.gh-pages/channels.json')).toBe(
|
expect(content('.gh-pages/channels.json')).toBe(
|
||||||
`[{"name":"BBC News HD","logo":"https://i.imgur.com/eNPIQ9f.png","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","categories":[{"name":"News","slug":"news"}],"countries":[{"name":"United Kingdom","code":"UK"}],"languages":[{"name":"English","code":"eng"}],"tvg":{"id":"BBCNews.uk","name":"BBC News HD","url":""}},{"name":"ЛДПР ТВ","logo":"https://iptvx.one/icn/ldpr-tv.png","url":"http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8","categories":[{"name":"General","slug":"general"}],"countries":[{"name":"Russia","code":"RU"}],"languages":[{"name":"Russian","code":"rus"}],"tvg":{"id":"LDPRTV.ru","name":"ЛДПР ТВ","url":"https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"}}]`
|
`[{"name":"BBC News HD","logo":"https://i.imgur.com/eNPIQ9f.png","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","categories":[{"name":"News","slug":"news"}],"countries":[{"name":"United Kingdom","code":"UK"}],"languages":[{"name":"English","code":"eng"}],"tvg":{"id":"BBCNews.uk","name":"BBC News HD","url":""}},{"name":"Visit-X TV","logo":"","url":"https://stream.visit-x.tv/vxtv/ngrp:live_all/playlist.m3u8","categories":[{"name":"XXX","slug":"xxx"}],"countries":[],"languages":[],"tvg":{"id":"","name":"Visit-X TV","url":""}},{"name":"ЛДПР ТВ","logo":"https://iptvx.one/icn/ldpr-tv.png","url":"http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8","categories":[{"name":"General","slug":"general"},{"name":"Legislative","slug":"legislative"}],"countries":[{"name":"Russia","code":"RU"}],"languages":[{"name":"Russian","code":"rus"}],"tvg":{"id":"LDPRTV.ru","name":"ЛДПР ТВ","url":"https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"}}]`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can generate index.category.m3u', () => {
|
it('can generate index.category.m3u', () => {
|
||||||
expect(content('.gh-pages/index.category.m3u'))
|
expect(content('.gh-pages/index.category.m3u'))
|
||||||
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
||||||
#EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="UK" tvg-language="English" tvg-logo="https://i.imgur.com/eNPIQ9f.png" group-title="News",BBC News HD (720p) [Not 24/7]
|
|
||||||
http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
|
||||||
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General",ЛДПР ТВ (1080p)
|
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General",ЛДПР ТВ (1080p)
|
||||||
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
|
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="Legislative",ЛДПР ТВ (1080p)
|
||||||
|
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
|
#EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="UK" tvg-language="English" tvg-logo="https://i.imgur.com/eNPIQ9f.png" group-title="News",BBC News HD (720p) [Not 24/7]
|
||||||
|
http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
||||||
`)
|
`)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -151,7 +159,7 @@ it('can generate index.m3u', () => {
|
||||||
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
||||||
#EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="UK" tvg-language="English" tvg-logo="https://i.imgur.com/eNPIQ9f.png" group-title="News",BBC News HD (720p) [Not 24/7]
|
#EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="UK" tvg-language="English" tvg-logo="https://i.imgur.com/eNPIQ9f.png" group-title="News",BBC News HD (720p) [Not 24/7]
|
||||||
http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
||||||
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General",ЛДПР ТВ (1080p)
|
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General;Legislative",ЛДПР ТВ (1080p)
|
||||||
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
`)
|
`)
|
||||||
})
|
})
|
||||||
|
@ -161,7 +169,9 @@ it('can generate index.nsfw.m3u', () => {
|
||||||
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
.toBe(`#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xml"
|
||||||
#EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="UK" tvg-language="English" tvg-logo="https://i.imgur.com/eNPIQ9f.png" group-title="News",BBC News HD (720p) [Not 24/7]
|
#EXTINF:-1 tvg-id="BBCNews.uk" tvg-country="UK" tvg-language="English" tvg-logo="https://i.imgur.com/eNPIQ9f.png" group-title="News",BBC News HD (720p) [Not 24/7]
|
||||||
http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
||||||
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General",ЛДПР ТВ (1080p)
|
#EXTINF:-1 tvg-id="" tvg-country="" tvg-language="" tvg-logo="" group-title="XXX",Visit-X TV
|
||||||
|
https://stream.visit-x.tv/vxtv/ngrp:live_all/playlist.m3u8
|
||||||
|
#EXTINF:-1 tvg-id="LDPRTV.ru" tvg-country="RU" tvg-language="Russian" tvg-logo="https://iptvx.one/icn/ldpr-tv.png" group-title="General;Legislative",ЛДПР ТВ (1080p)
|
||||||
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
`)
|
`)
|
||||||
})
|
})
|
||||||
|
@ -169,7 +179,9 @@ http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8
|
||||||
it('can generate logs categories', () => {
|
it('can generate logs categories', () => {
|
||||||
expect(content('logs/generate-playlists/categories.log'))
|
expect(content('logs/generate-playlists/categories.log'))
|
||||||
.toBe(`{"name":"General","slug":"general","count":1}
|
.toBe(`{"name":"General","slug":"general","count":1}
|
||||||
|
{"name":"Legislative","slug":"legislative","count":1}
|
||||||
{"name":"News","slug":"news","count":1}
|
{"name":"News","slug":"news","count":1}
|
||||||
|
{"name":"XXX","slug":"xxx","count":1}
|
||||||
{"name":"Other","slug":"other","count":0}
|
{"name":"Other","slug":"other","count":0}
|
||||||
`)
|
`)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue