mirror of
https://github.com/iptv-org/epg
synced 2026-04-22 10:37:02 -04:00
Fix linter issues in sites/
This commit is contained in:
@@ -13,19 +13,17 @@ module.exports = {
|
||||
site: 'programme.tvb.com',
|
||||
days: 2,
|
||||
url({ channel, date, time = null }) {
|
||||
return `https://programme.tvb.com/api/schedule?input_date=${
|
||||
date.format('YYYYMMDD')
|
||||
}&network_code=${channel.site_id}&_t=${time ? time : parseInt(Date.now() / 1000)}`
|
||||
return `https://programme.tvb.com/api/schedule?input_date=${date.format(
|
||||
'YYYYMMDD'
|
||||
)}&network_code=${channel.site_id}&_t=${time ? time : parseInt(Date.now() / 1000)}`
|
||||
},
|
||||
parser({ content, channel, date }) {
|
||||
const programs = []
|
||||
const data = content ? JSON.parse(content) : {}
|
||||
if (Array.isArray(data.data?.list)) {
|
||||
const dt = date.format('YYYY-MM-DD')
|
||||
for (const d of data.data.list) {
|
||||
if (Array.isArray(d.schedules)) {
|
||||
const schedules = d.schedules
|
||||
.filter(s => s.network_code === channel.site_id)
|
||||
const schedules = d.schedules.filter(s => s.network_code === channel.site_id)
|
||||
schedules.forEach((s, i) => {
|
||||
const start = dayjs.tz(s.event_datetime, 'YYYY-MM-DD HH:mm:ss', tz)
|
||||
let stop
|
||||
@@ -64,7 +62,7 @@ module.exports = {
|
||||
if (assets) {
|
||||
queues.push(...assets.map(a => base + '/' + a))
|
||||
} else {
|
||||
const metadata = content.match(/e\=(\[(.*?)\])/)
|
||||
const metadata = content.match(/e=(\[(.*?)\])/)
|
||||
if (metadata) {
|
||||
const infos = eval(metadata[1])
|
||||
if (Array.isArray(infos)) {
|
||||
|
||||
@@ -34,7 +34,7 @@ it('can parse response (en)', () => {
|
||||
expect(results[1]).toMatchObject({
|
||||
start: '2024-12-06T15:55:00.000Z',
|
||||
stop: '2024-12-06T16:55:00.000Z',
|
||||
title: 'Line Walker: Bull Fight#16[Can][PG]',
|
||||
title: 'Line Walker: Bull Fight#16[Can][PG]'
|
||||
})
|
||||
})
|
||||
|
||||
@@ -51,7 +51,7 @@ it('can parse response (zh)', () => {
|
||||
stop: '2024-12-06T16:55:00.000Z',
|
||||
title: '使徒行者3#16[粵][PG]',
|
||||
description:
|
||||
'文鼎從淑梅手上救走大聖爺兒子,大聖爺還恩於歡喜,答允支持九指強。崇聯社定下選舉日子,恰巧是韋傑出獄之日,頭目們顧念舊日恩義,紛紛轉投浩洋。浩洋帶亞希逛傢俬店,憧憬二人未來。亞希向家強承認愛上浩洋,要求退出臥底任務。作榮與歡喜暗中會面,將國際犯罪組織「永恆幫」情報交給他。阿火遭家強出賣,到沐足店搶錢。家強逮住阿火,惟被合星誤會而受拘捕。家強把正植遺下的頸鏈和學生證交還,合星意識到家強已知悉正植身世。',
|
||||
'文鼎從淑梅手上救走大聖爺兒子,大聖爺還恩於歡喜,答允支持九指強。崇聯社定下選舉日子,恰巧是韋傑出獄之日,頭目們顧念舊日恩義,紛紛轉投浩洋。浩洋帶亞希逛傢俬店,憧憬二人未來。亞希向家強承認愛上浩洋,要求退出臥底任務。作榮與歡喜暗中會面,將國際犯罪組織「永恆幫」情報交給他。阿火遭家強出賣,到沐足店搶錢。家強逮住阿火,惟被合星誤會而受拘捕。家強把正植遺下的頸鏈和學生證交還,合星意識到家強已知悉正植身世。'
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user