mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-11 09:30:06 -04:00
Update /sites
This commit is contained in:
parent
ca254a6df0
commit
c0cfcf7a47
543 changed files with 30781 additions and 31187 deletions
|
@ -1,5 +1,5 @@
|
|||
// npm run channels:parse -- --config=./sites/nowplayer.now.com/nowplayer.now.com.config.js --output=./sites/nowplayer.now.com/nowplayer.now.com.channels.xml --set=lang:zh
|
||||
// npx epg-grabber --config=sites/nowplayer.now.com/nowplayer.now.com.config.js --channels=sites/nowplayer.now.com/nowplayer.now.com.channels.xml --output=guide.xml --timeout=30000 --days=2
|
||||
// npm run grab -- --site=nowplayer.now.com
|
||||
|
||||
const { parser, url, request } = require('./nowplayer.now.com.config.js')
|
||||
const dayjs = require('dayjs')
|
||||
|
@ -30,12 +30,13 @@ it('can generate valid url for tomorrow', () => {
|
|||
|
||||
it('can generate valid request headers', () => {
|
||||
expect(request.headers({ channel })).toMatchObject({
|
||||
Cookie: `LANG=zh; Expires=null; Path=/; Domain=nowplayer.now.com`
|
||||
Cookie: 'LANG=zh; Expires=null; Path=/; Domain=nowplayer.now.com'
|
||||
})
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
const content = `[[{"key":"key_202111174524739","vimProgramId":"202111174524739","name":"ViuTVsix Station Closing","start":1637690400000,"end":1637715600000,"date":"20211124","startTime":"02:00AM","endTime":"09:00AM","duration":420,"recordable":false,"restartTv":false,"npvrProg":false,"npvrStartTime":0,"npvrEndTime":0,"cid":"viutvsix station closing","cc":"","isInWatchlist":false}]]`
|
||||
const content =
|
||||
'[[{"key":"key_202111174524739","vimProgramId":"202111174524739","name":"ViuTVsix Station Closing","start":1637690400000,"end":1637715600000,"date":"20211124","startTime":"02:00AM","endTime":"09:00AM","duration":420,"recordable":false,"restartTv":false,"npvrProg":false,"npvrStartTime":0,"npvrEndTime":0,"cid":"viutvsix station closing","cc":"","isInWatchlist":false}]]'
|
||||
const result = parser({ content }).map(p => {
|
||||
p.start = p.start.toJSON()
|
||||
p.stop = p.stop.toJSON()
|
||||
|
@ -53,7 +54,7 @@ it('can parse response', () => {
|
|||
|
||||
it('can handle empty guide', () => {
|
||||
const result = parser({
|
||||
content: `[[]]`
|
||||
content: '[[]]'
|
||||
})
|
||||
expect(result).toMatchObject([])
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue