mirror of
https://github.com/iptv-org/epg
synced 2026-05-01 06:56:59 -04:00
Update /sites
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// node ./scripts/commands/parse-channels.js --config=./sites/tv.dir.bg/tv.dir.bg.config.js --output=./sites/tv.dir.bg/tv.dir.bg.channels.xml
|
||||
// npx epg-grabber --config=sites/tv.dir.bg/tv.dir.bg.config.js --channels=sites/tv.dir.bg/tv.dir.bg.channels.xml --output=guide.xml
|
||||
// npm run grab -- --site=tv.dir.bg
|
||||
|
||||
const { parser, url } = require('./tv.dir.bg.config.js')
|
||||
const dayjs = require('dayjs')
|
||||
@@ -19,7 +19,8 @@ it('can generate valid url', () => {
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
const content = `<!DOCTYPE html><html><head></head><body><div class="container" id="news"><div class="row"><div class="col-sm-12 col-md-5"><ul id="events"><li><i></i> <div class="progress"> <div class="progress-bar progress-bar-striped active" role="progressbar" style="width:99%"> </div></div></li><li><a href="tv_show_info.php?id"="10"><i>06.00</i>„<b>Тази сутрин</b>” - информационно предаване с водещи Златимир Йочеви Биляна Гавазова</a></li><li><i>15.00</i>„Доктор Чудо” - сериал, еп.71</li><li><a href="tv_show_info.php?id"="1601"><i>05.30</i>„<b>Лице в лице</b>” /п./ </a></li></ul></div></div></div></body></html>`
|
||||
const content =
|
||||
'<!DOCTYPE html><html><head></head><body><div class="container" id="news"><div class="row"><div class="col-sm-12 col-md-5"><ul id="events"><li><i></i> <div class="progress"> <div class="progress-bar progress-bar-striped active" role="progressbar" style="width:99%"> </div></div></li><li><a href="tv_show_info.php?id"="10"><i>06.00</i>„<b>Тази сутрин</b>” - информационно предаване с водещи Златимир Йочеви Биляна Гавазова</a></li><li><i>15.00</i>„Доктор Чудо” - сериал, еп.71</li><li><a href="tv_show_info.php?id"="1601"><i>05.30</i>„<b>Лице в лице</b>” /п./ </a></li></ul></div></div></div></body></html>'
|
||||
const result = parser({ content, date }).map(p => {
|
||||
p.start = p.start.toJSON()
|
||||
p.stop = p.stop.toJSON()
|
||||
@@ -30,17 +31,17 @@ it('can parse response', () => {
|
||||
{
|
||||
start: '2022-01-20T04:00:00.000Z',
|
||||
stop: '2022-01-20T13:00:00.000Z',
|
||||
title: `„Тази сутрин” - информационно предаване с водещи Златимир Йочеви Биляна Гавазова`
|
||||
title: '„Тази сутрин” - информационно предаване с водещи Златимир Йочеви Биляна Гавазова'
|
||||
},
|
||||
{
|
||||
start: '2022-01-20T13:00:00.000Z',
|
||||
stop: '2022-01-21T03:30:00.000Z',
|
||||
title: `„Доктор Чудо” - сериал, еп.71`
|
||||
title: '„Доктор Чудо” - сериал, еп.71'
|
||||
},
|
||||
{
|
||||
start: '2022-01-21T03:30:00.000Z',
|
||||
stop: '2022-01-21T04:00:00.000Z',
|
||||
title: `„Лице в лице” /п./`
|
||||
title: '„Лице в лице” /п./'
|
||||
}
|
||||
])
|
||||
})
|
||||
@@ -49,7 +50,8 @@ it('can handle empty guide', () => {
|
||||
const result = parser({
|
||||
date,
|
||||
channel,
|
||||
content: `<!DOCTYPE html><html><head></head><body><div class="container" id="news"><div class="row"><div class="col-sm-12 col-md-5"><ul id="events"></ul></div></div></div></body></html>`
|
||||
content:
|
||||
'<!DOCTYPE html><html><head></head><body><div class="container" id="news"><div class="row"><div class="col-sm-12 col-md-5"><ul id="events"></ul></div></div></div></body></html>'
|
||||
})
|
||||
expect(result).toMatchObject([])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user