Update /sites

This commit is contained in:
freearhey 2023-10-02 06:35:33 +03:00
parent ca254a6df0
commit c0cfcf7a47
543 changed files with 30781 additions and 31187 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
// npx epg-grabber --config=sites/tvtv.us/tvtv.us.config.js --channels=sites/tvtv.us/tvtv.us.channels.xml --output=guide.xml
// npm run grab -- --site=tvtv.us
const { parser, url } = require('./tvtv.us.config.js')
const dayjs = require('dayjs')
@ -21,7 +21,8 @@ it('can generate valid url', () => {
})
it('can parse response', () => {
const content = `[[{"programId":"EP039131940001","title":"Beyond the Field","subtitle":"Diversity in Sport","flags":["CC","DVS"],"type":"O","startTime":"2022-09-20T00:00Z","start":0,"duration":30,"runTime":30},{"programId":"EP032368970002","title":"IGotThis","subtitle":"Listen to Dis","flags":["CC","DVS"],"type":"O","startTime":"2022-09-20T00:30Z","start":120,"duration":30,"runTime":30}]]`
const content =
'[[{"programId":"EP039131940001","title":"Beyond the Field","subtitle":"Diversity in Sport","flags":["CC","DVS"],"type":"O","startTime":"2022-09-20T00:00Z","start":0,"duration":30,"runTime":30},{"programId":"EP032368970002","title":"IGotThis","subtitle":"Listen to Dis","flags":["CC","DVS"],"type":"O","startTime":"2022-09-20T00:30Z","start":120,"duration":30,"runTime":30}]]'
const result = parser({ content }).map(p => {
p.start = p.start.toJSON()
@ -34,20 +35,20 @@ it('can parse response', () => {
start: '2022-09-20T00:00:00.000Z',
stop: '2022-09-20T00:30:00.000Z',
title: 'Beyond the Field',
description: `Diversity in Sport`
description: 'Diversity in Sport'
},
{
start: '2022-09-20T00:30:00.000Z',
stop: '2022-09-20T01:00:00.000Z',
title: 'IGotThis',
description: `Listen to Dis`
description: 'Listen to Dis'
}
])
})
it('can handle empty guide', () => {
const result = parser({
content: `[]`
content: '[]'
})
expect(result).toMatchObject([])
})