mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update tvtv.us.config.js
This commit is contained in:
parent
37c90413a4
commit
fae6d88d6f
1 changed files with 14 additions and 13 deletions
|
@ -4,22 +4,25 @@ const utc = require('dayjs/plugin/utc')
|
|||
dayjs.extend(utc)
|
||||
|
||||
module.exports = {
|
||||
ignore: true, // NOTE: return an HTTP error 503 (Service Unavailable) on every request from GitHub server only (https://github.com/iptv-org/epg/issues/1172#issuecomment-1284261669)
|
||||
site: 'tvtv.us',
|
||||
url: function ({ date, channel }) {
|
||||
return `https://www.tvtv.us/api/v1/lineup/USA-NY71652-DEFAULT/grid/${date.toJSON()}/${date.add(1, 'd').toJSON()}/${channel.site_id}`
|
||||
return `https://www.tvtv.us/api/v1/lineup/USA-NY71652-DEFAULT/grid/${date.toJSON()}/${date
|
||||
.add(1, 'd')
|
||||
.toJSON()}/${channel.site_id}`
|
||||
},
|
||||
parser: function ({ content }) {
|
||||
let programs = []
|
||||
|
||||
const items = parseItems(content)
|
||||
items.forEach(item => {
|
||||
const start = dayjs.utc(item.startTime)
|
||||
const stop = start.add(item.runTime, 'm')
|
||||
programs.push({
|
||||
title: item.title,
|
||||
description: item.subtitle,
|
||||
start,
|
||||
stop
|
||||
const start = dayjs.utc(item.startTime)
|
||||
const stop = start.add(item.runTime, 'm')
|
||||
programs.push({
|
||||
title: item.title,
|
||||
description: item.subtitle,
|
||||
start,
|
||||
stop
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -27,10 +30,8 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function parseItems(content) {
|
||||
const json = JSON.parse(content)
|
||||
if (!json.length) return []
|
||||
return json[0]
|
||||
const json = JSON.parse(content)
|
||||
if (!json.length) return []
|
||||
return json[0]
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue