mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
Fix linter issues in sites/
This commit is contained in:
parent
d6d20b6413
commit
5df982bb7c
129 changed files with 3316 additions and 3226 deletions
|
@ -12,9 +12,7 @@ module.exports = {
|
|||
site: 'sky.com',
|
||||
days: 2,
|
||||
url({ date, channel }) {
|
||||
return `https://awk.epgsky.com/hawk/linear/schedule/${
|
||||
date.format('YYYYMMDD')
|
||||
}/${
|
||||
return `https://awk.epgsky.com/hawk/linear/schedule/${date.format('YYYYMMDD')}/${
|
||||
channel.site_id
|
||||
}`
|
||||
},
|
||||
|
@ -27,19 +25,18 @@ module.exports = {
|
|||
.filter(schedule => schedule.sid === channel.site_id)
|
||||
.forEach(schedule => {
|
||||
if (Array.isArray(schedule.events)) {
|
||||
schedule.events
|
||||
.forEach(event => {
|
||||
const start = dayjs.utc(event.st * 1000)
|
||||
const stop = start.add(event.d, 's')
|
||||
programs.push({
|
||||
title: event.t,
|
||||
description: event.sy,
|
||||
season: event.seasonnumber,
|
||||
episode: event.episodenumber,
|
||||
start,
|
||||
stop
|
||||
})
|
||||
schedule.events.forEach(event => {
|
||||
const start = dayjs.utc(event.st * 1000)
|
||||
const stop = start.add(event.d, 's')
|
||||
programs.push({
|
||||
title: event.t,
|
||||
description: event.sy,
|
||||
season: event.seasonnumber,
|
||||
episode: event.episodenumber,
|
||||
start,
|
||||
stop
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -55,10 +52,12 @@ module.exports = {
|
|||
if (queue.t === 'r') {
|
||||
const $ = cheerio.load(res)
|
||||
const initialData = JSON.parse(decodeURIComponent($('#initialData').text()))
|
||||
initialData.state.epgData.regions
|
||||
.forEach(region => {
|
||||
queues.push({ t: 'c', url: `https://awk.epgsky.com/hawk/linear/services/${region.bouquet}/${region.subBouquet}` })
|
||||
initialData.state.epgData.regions.forEach(region => {
|
||||
queues.push({
|
||||
t: 'c',
|
||||
url: `https://awk.epgsky.com/hawk/linear/services/${region.bouquet}/${region.subBouquet}`
|
||||
})
|
||||
})
|
||||
}
|
||||
// process channels
|
||||
if (queue.t === 'c') {
|
||||
|
|
|
@ -15,9 +15,7 @@ const channel = {
|
|||
}
|
||||
|
||||
it('can generate valid url', () => {
|
||||
expect(url({ channel, date })).toBe(
|
||||
'https://awk.epgsky.com/hawk/linear/schedule/20241214/4086'
|
||||
)
|
||||
expect(url({ channel, date })).toBe('https://awk.epgsky.com/hawk/linear/schedule/20241214/4086')
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
|
@ -34,7 +32,7 @@ it('can parse response', () => {
|
|||
stop: '2024-12-13T23:00:00.000Z',
|
||||
title: 'The UnXplained With...',
|
||||
description:
|
||||
'The Hunt for Jack the Ripper: Jack the Ripper\'s identity has eluded police, historians and armchair detectives for over a century. What do we know about the notorious killer? (S3, ep 21)',
|
||||
"The Hunt for Jack the Ripper: Jack the Ripper's identity has eluded police, historians and armchair detectives for over a century. What do we know about the notorious killer? (S3, ep 21)",
|
||||
season: 4,
|
||||
episode: 14
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue