mirror of
https://github.com/iptv-org/epg
synced 2026-05-08 18:36:59 -04:00
Merge pull request #3093 from iptv-org/update-ontvtonight.com
Update ontvtonight.com
This commit is contained in:
@@ -21,6 +21,12 @@ module.exports = {
|
||||
|
||||
return url
|
||||
},
|
||||
request: {
|
||||
headers: {
|
||||
'user-agent':
|
||||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36'
|
||||
}
|
||||
},
|
||||
parser: function ({ content, date, channel }) {
|
||||
const programs = []
|
||||
const items = parseItems(content)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { parser, url } = require('./ontvtonight.com.config.js')
|
||||
const { parser, url, request } = require('./ontvtonight.com.config.js')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const dayjs = require('dayjs')
|
||||
@@ -19,6 +19,13 @@ it('can generate valid url', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('can generate valid request headers', () => {
|
||||
expect(request.headers).toMatchObject({
|
||||
'user-agent':
|
||||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36'
|
||||
})
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html'), 'utf8')
|
||||
const result = parser({ content, channel, date }).map(p => {
|
||||
|
||||
Reference in New Issue
Block a user