GitHub节目单日期问题
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
账号🐔了。~~只有标清..~~ 高清为主😅 gitee仓库被改私有了..
|
||||
|
||||
~~gitee ip被ban,仓库链接已失效~~
|
||||
仓库地址临时复活,能活多久看运气,目前存在频道缺失或无法播放的问题,回放功能仅migu源生效,还在测试。
|
||||
|
||||
仓库地址临时复活,能活多久看运气,存在频道缺失或无法播放的问题,回放功能仅migu源生效,还在测试。
|
||||
|
||||
访问地址(可回看当天内容)
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ printMagenta("开始更新...")
|
||||
const datas = await dataList()
|
||||
printGreen("数据获取成功!")
|
||||
|
||||
|
||||
try {
|
||||
const playbackFile = `${process.cwd()}/playback.xml.bak`
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user