mirror of
https://github.com/iptv-org/epg
synced 2025-12-18 11:27:06 -05:00
Fix osn.com
This commit is contained in:
@@ -9,6 +9,10 @@ module.exports = {
|
|||||||
site: 'osn.com',
|
site: 'osn.com',
|
||||||
request: {
|
request: {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
Referer: 'https://www.osn.com'
|
||||||
|
},
|
||||||
data({ channel, date }) {
|
data({ channel, date }) {
|
||||||
const [selectedCountry, channelCode] = channel.site_id.split('#')
|
const [selectedCountry, channelCode] = channel.site_id.split('#')
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// NODE_OPTIONS=--insecure-http-parser npx epg-grabber --config=sites/osn.com/osn.com.config.js --channels=sites/osn.com/osn.com_ae.channels.xml --days=2 --output=guide.xml
|
// NODE_OPTIONS=--insecure-http-parser npx epg-grabber --config=sites/osn.com/osn.com.config.js --channels=sites/osn.com/osn.com_ae.channels.xml --output=guide.xml --days=2
|
||||||
|
|
||||||
const { parser, url, logo, request } = require('./osn.com.config.js')
|
const { parser, url, logo, request } = require('./osn.com.config.js')
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
@@ -24,6 +24,14 @@ it('can generate valid request data', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('can generate valid request headers', () => {
|
||||||
|
const result = request.headers
|
||||||
|
expect(result).toMatchObject({
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
Referer: 'https://www.osn.com'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
it('can generate valid url', () => {
|
it('can generate valid url', () => {
|
||||||
const result = url()
|
const result = url()
|
||||||
expect(result).toBe(
|
expect(result).toBe(
|
||||||
|
|||||||
Reference in New Issue
Block a user