From 435a4a10249d650370b9f02c60851338912568d7 Mon Sep 17 00:00:00 2001 From: test Date: Mon, 15 Dec 2025 20:16:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8flv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- fetchURLByAndroid720p.js | 2 +- updateData.js | 7 ++++++- utils/androidURL.js | 12 ++++++++---- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index 5506284..9e2a6a5 100644 --- a/app.js +++ b/app.js @@ -214,7 +214,7 @@ const server = http.createServer(async (req, res) => { const location = obj.headers.get("Location") if (location != "" && location != undefined && location != null) { - if (location.startsWith("http://hlsz") || location.startsWith("http://mgsp") || location.startsWith("http://trial")) { + if (!location.startsWith("http://bofang")) { resObj.url = location break } diff --git a/fetchURLByAndroid720p.js b/fetchURLByAndroid720p.js index 798f45c..c3732d8 100644 --- a/fetchURLByAndroid720p.js +++ b/fetchURLByAndroid720p.js @@ -58,7 +58,7 @@ async function fetchURLByAndroid720p() { if (location == "" || location == undefined || location == null) { continue } - if (location.startsWith("http://hlsz")) { + if (!location.startsWith("http://bofang")) { resObj.url = location break } diff --git a/updateData.js b/updateData.js index 819e1e2..5b4bf6d 100644 --- a/updateData.js +++ b/updateData.js @@ -134,7 +134,12 @@ async function updatePE(hours) { continue } if (replay.name.match(/.*回放|赛.*/) != null) { - const competitionDesc = `${data.competitionName} ${pkInfoTitle} ${replay.name} ${peResult.body.multiPlayList.preList[peResult.body.multiPlayList.preList.length - 1].startTimeStr.substring(11, 16)}` + let timeStr = peResult.body.keyword.substring(7) + const peResultStartTimeStr = peResult.body.multiPlayList.preList[peResult.body.multiPlayList.preList.length - 1].startTimeStr + if (peResultStartTimeStr != undefined) { + timeStr = peResultStartTimeStr.substring(11, 16) + } + const competitionDesc = `${data.competitionName} ${pkInfoTitle} ${replay.name} ${timeStr}` // 写入赛事 appendFileSync(interfacePath, `#EXTINF:-1 tvg-id="${pkInfoTitle}" tvg-name="${competitionDesc}" tvg-logo="${data.competitionLogo}" group-title="体育-${relativeDate}",${competitionDesc}\n\${replace}/${replay.pID}\n`) appendFileSync(interfaceTXTPath, `${competitionDesc},\${replace}/${replay.pID}\n`) diff --git a/utils/androidURL.js b/utils/androidURL.js index 4b76304..3dd703b 100644 --- a/utils/androidURL.js +++ b/utils/androidURL.js @@ -45,7 +45,8 @@ async function getAndroidURL(userId, token, pid, rateType) { let headers = { AppVersion: 2600037000, TerminalId: "android", - "X-UP-CLIENT-CHANNEL-ID": "2600037000-99000-200300220100002" + "X-UP-CLIENT-CHANNEL-ID": "2600037000-99000-200300220100002", + "appCode": "miguvideo_default_android" } // 广东卫视有些特殊 @@ -65,7 +66,7 @@ async function getAndroidURL(userId, token, pid, rateType) { // 请求 const baseURL = "https://play.miguvideo.com/playurl/v1/play/playurl" let params = "?sign=" + result.sign + "&rateType=" + rateType - + "&contId=" + pid + "×tamp=" + timestramp + "&salt=" + result.salt + + "&contId=" + pid + "×tamp=" + timestramp + "&salt=" + result.salt + "&flvEnable=true" let respData = await fetch(baseURL + params, { headers: headers }).then(r => r.json()) @@ -92,6 +93,7 @@ async function getAndroidURL(userId, token, pid, rateType) { content: respData } } + pid = respData.body.content.contId // 将URL加密 const resURL = getddCalcuURL(url, pid, "android", rateType) @@ -120,7 +122,8 @@ async function getAndroidURL720p(pid) { let headers = { AppVersion: `${appVersion}`, TerminalId: "android", - "X-UP-CLIENT-CHANNEL-ID": `${appVersionID}` + "X-UP-CLIENT-CHANNEL-ID": `${appVersionID}`, + "appCode": "miguvideo_default_android" } // console.log(headers) const str = timestramp + pid + appVersion.substring(0, 8) @@ -138,7 +141,7 @@ async function getAndroidURL720p(pid) { // 请求 const baseURL = "https://play.miguvideo.com/playurl/v1/play/playurl" const params = "?sign=" + sign + "&rateType=" + rateType - + "&contId=" + pid + "×tamp=" + timestramp + "&salt=" + salt + + "&contId=" + pid + "×tamp=" + timestramp + "&salt=" + salt + "&flvEnable=true" const respData = await fetch(baseURL + params, { headers: headers }).then(r => r.json()) @@ -157,6 +160,7 @@ async function getAndroidURL720p(pid) { } rateType = respData.body.urlInfo?.rateType + pid = respData.body.content.contId // 将URL加密 const resURL = getddCalcuURL720p(url, pid)