mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update osn.com
This commit is contained in:
parent
a99b4ea7a5
commit
69be299373
2 changed files with 3 additions and 16 deletions
|
@ -7,6 +7,7 @@ dayjs.extend(timezone)
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
site: 'osn.com',
|
site: 'osn.com',
|
||||||
|
url: `https://www.osn.com/CMSPages/TVScheduleWebService.asmx/GetTVChannelsProgramTimeTable`,
|
||||||
request: {
|
request: {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -25,14 +26,6 @@ module.exports = {
|
||||||
},
|
},
|
||||||
jar: null
|
jar: null
|
||||||
},
|
},
|
||||||
url: function () {
|
|
||||||
return `https://www.osn.com/CMSPages/TVScheduleWebService.asmx/GetTVChannelsProgramTimeTable`
|
|
||||||
},
|
|
||||||
logo: function ({ channel }) {
|
|
||||||
const [_, channelCode] = channel.site_id.split('#')
|
|
||||||
|
|
||||||
return `https://content.osn.com/logo/channel/cropped/${channelCode}.png`
|
|
||||||
},
|
|
||||||
parser: function ({ content, channel }) {
|
parser: function ({ content, channel }) {
|
||||||
let programs = []
|
let programs = []
|
||||||
const items = parseItems(content)
|
const items = parseItems(content)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// NODE_OPTIONS=--insecure-http-parser npx epg-grabber --config=sites/osn.com/osn.com.config.js --channels=sites/osn.com/osn.com_ae-ar.channels.xml --output=guide.xml --days=2
|
// NODE_OPTIONS=--insecure-http-parser npx epg-grabber --config=sites/osn.com/osn.com.config.js --channels=sites/osn.com/osn.com_ae-ar.channels.xml --output=guide.xml --days=2
|
||||||
// NODE_OPTIONS=--insecure-http-parser npx epg-grabber --config=sites/osn.com/osn.com.config.js --channels=sites/osn.com/osn.com_ae-en.channels.xml --output=guide.xml --days=2
|
// NODE_OPTIONS=--insecure-http-parser npx epg-grabber --config=sites/osn.com/osn.com.config.js --channels=sites/osn.com/osn.com_ae-en.channels.xml --output=guide.xml --days=2
|
||||||
|
|
||||||
const { parser, url, logo, request } = require('./osn.com.config.js')
|
const { parser, url, request } = require('./osn.com.config.js')
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const utc = require('dayjs/plugin/utc')
|
const utc = require('dayjs/plugin/utc')
|
||||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||||
|
@ -35,17 +35,11 @@ it('can generate valid request headers', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can generate valid url', () => {
|
it('can generate valid url', () => {
|
||||||
const result = url()
|
expect(url).toBe(
|
||||||
expect(result).toBe(
|
|
||||||
'https://www.osn.com/CMSPages/TVScheduleWebService.asmx/GetTVChannelsProgramTimeTable'
|
'https://www.osn.com/CMSPages/TVScheduleWebService.asmx/GetTVChannelsProgramTimeTable'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can get logo url', () => {
|
|
||||||
const result = logo({ channel: channelAR })
|
|
||||||
expect(result).toBe('https://content.osn.com/logo/channel/cropped/AAN.png')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('can parse response (ar)', () => {
|
it('can parse response (ar)', () => {
|
||||||
const result = parser({ date, channel: channelAR, content })
|
const result = parser({ date, channel: channelAR, content })
|
||||||
expect(result).toMatchObject([
|
expect(result).toMatchObject([
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue