mirror of
https://github.com/iptv-org/epg
synced 2025-12-16 10:26:41 -05:00
Update /sites
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<site site="andorradifusio.ad">
|
||||
<channels>
|
||||
<channel lang="ca" xmltv_id="AndorraTV.ad" site_id="atv">Andorra TV</channel>
|
||||
</channels>
|
||||
</site>
|
||||
<channels>
|
||||
<channel site="andorradifusio.ad" lang="ca" xmltv_id="AndorraTV.ad" site_id="atv">Andorra TV</channel>
|
||||
</channels>
|
||||
@@ -47,8 +47,8 @@ function parseItems(content, date) {
|
||||
.parent()
|
||||
.parent()
|
||||
const items = []
|
||||
const titles = column.find(`p`).toArray()
|
||||
column.find(`h4`).each((i, time) => {
|
||||
const titles = column.find('p').toArray()
|
||||
column.find('h4').each((i, time) => {
|
||||
items.push({
|
||||
time: $(time).text(),
|
||||
title: $(titles[i]).text()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// npx epg-grabber --config=sites/andorradifusio.ad/andorradifusio.ad.config.js --channels=sites/andorradifusio.ad/andorradifusio.ad.channels.xml --output=guide.xml
|
||||
// npm run grab -- --site=andorradifusio.ad
|
||||
|
||||
const { parser, url } = require('./andorradifusio.ad.config.js')
|
||||
const fs = require('fs')
|
||||
@@ -30,20 +30,20 @@ it('can parse response', () => {
|
||||
expect(results[0]).toMatchObject({
|
||||
start: '2023-06-07T05:00:00.000Z',
|
||||
stop: '2023-06-07T06:00:00.000Z',
|
||||
title: `Club Piolet`
|
||||
title: 'Club Piolet'
|
||||
})
|
||||
|
||||
expect(results[20]).toMatchObject({
|
||||
start: '2023-06-07T23:00:00.000Z',
|
||||
stop: '2023-06-08T00:00:00.000Z',
|
||||
title: `Àrea Andorra Difusió`
|
||||
title: 'Àrea Andorra Difusió'
|
||||
})
|
||||
})
|
||||
|
||||
it('can handle empty guide', () => {
|
||||
const result = parser({
|
||||
date,
|
||||
content: `<!DOCTYPE html><html><head></head><body></body></html>`
|
||||
content: '<!DOCTYPE html><html><head></head><body></body></html>'
|
||||
})
|
||||
expect(result).toMatchObject([])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user