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 = {
|
||||
site: 'osn.com',
|
||||
url: `https://www.osn.com/CMSPages/TVScheduleWebService.asmx/GetTVChannelsProgramTimeTable`,
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
@ -25,14 +26,6 @@ module.exports = {
|
|||
},
|
||||
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 }) {
|
||||
let programs = []
|
||||
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-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 utc = require('dayjs/plugin/utc')
|
||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
|
@ -35,17 +35,11 @@ it('can generate valid request headers', () => {
|
|||
})
|
||||
|
||||
it('can generate valid url', () => {
|
||||
const result = url()
|
||||
expect(result).toBe(
|
||||
expect(url).toBe(
|
||||
'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)', () => {
|
||||
const result = parser({ date, channel: channelAR, content })
|
||||
expect(result).toMatchObject([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue