GitHub节目单日期问题

This commit is contained in:
develop202
2026-01-16 07:45:56 +08:00
parent 8a73d0de64
commit 2ab259b494
3 changed files with 6 additions and 6 deletions

View File

@@ -4,8 +4,8 @@ import { cntvNames } from "./datas.js"
import { fetchUrl } from "./net.js"
async function getPlaybackData(programId, timeout = 6000) {
const date = new Date()
async function getPlaybackData(programId, timeout = 6000, githubAnd8) {
const date = new Date(Date.now() + githubAnd8)
const today = getDateString(date)
const resp = await fetchUrl(`https://program-sc.miguvideo.com/live/v2/tv-programs-data/${programId}/${today}`, {}, timeout)
return resp.body?.program[0]?.content
@@ -13,7 +13,7 @@ async function getPlaybackData(programId, timeout = 6000) {
async function updatePlaybackDataByMigu(program, filePath, timeout = 6000, githubAnd8 = 0) {
// 今日节目数据
const playbackData = await getPlaybackData(program.pID, timeout)
const playbackData = await getPlaybackData(program.pID, timeout, githubAnd8)
if (!playbackData) {
return false
}
@@ -40,7 +40,7 @@ async function updatePlaybackDataByMigu(program, filePath, timeout = 6000, githu
async function updatePlaybackDataByCntv(program, filePath, timeout = 6000, githubAnd8 = 0) {
// 今日节目数据
const date = new Date()
const date = new Date(Date.now() + githubAnd8)
const today = getDateString(date)
const cntvName = cntvNames[program.name]
const resp = await fetchUrl(`https://api.cntv.cn/epg/epginfo3?serviceId=shiyi&d=${today}&c=${cntvName}`, {}, timeout)