mirror of
https://github.com/develop202/migu_video.git
synced 2025-12-16 23:09:37 +08:00
使用flv
This commit is contained in:
2
app.js
2
app.js
@@ -214,7 +214,7 @@ const server = http.createServer(async (req, res) => {
|
|||||||
const location = obj.headers.get("Location")
|
const location = obj.headers.get("Location")
|
||||||
|
|
||||||
if (location != "" && location != undefined && location != null) {
|
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
|
resObj.url = location
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ async function fetchURLByAndroid720p() {
|
|||||||
if (location == "" || location == undefined || location == null) {
|
if (location == "" || location == undefined || location == null) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (location.startsWith("http://hlsz")) {
|
if (!location.startsWith("http://bofang")) {
|
||||||
resObj.url = location
|
resObj.url = location
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,12 @@ async function updatePE(hours) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (replay.name.match(/.*回放|赛.*/) != null) {
|
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(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`)
|
appendFileSync(interfaceTXTPath, `${competitionDesc},\${replace}/${replay.pID}\n`)
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ async function getAndroidURL(userId, token, pid, rateType) {
|
|||||||
let headers = {
|
let headers = {
|
||||||
AppVersion: 2600037000,
|
AppVersion: 2600037000,
|
||||||
TerminalId: "android",
|
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"
|
const baseURL = "https://play.miguvideo.com/playurl/v1/play/playurl"
|
||||||
let params = "?sign=" + result.sign + "&rateType=" + rateType
|
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, {
|
let respData = await fetch(baseURL + params, {
|
||||||
headers: headers
|
headers: headers
|
||||||
}).then(r => r.json())
|
}).then(r => r.json())
|
||||||
@@ -92,6 +93,7 @@ async function getAndroidURL(userId, token, pid, rateType) {
|
|||||||
content: respData
|
content: respData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pid = respData.body.content.contId
|
||||||
|
|
||||||
// 将URL加密
|
// 将URL加密
|
||||||
const resURL = getddCalcuURL(url, pid, "android", rateType)
|
const resURL = getddCalcuURL(url, pid, "android", rateType)
|
||||||
@@ -120,7 +122,8 @@ async function getAndroidURL720p(pid) {
|
|||||||
let headers = {
|
let headers = {
|
||||||
AppVersion: `${appVersion}`,
|
AppVersion: `${appVersion}`,
|
||||||
TerminalId: "android",
|
TerminalId: "android",
|
||||||
"X-UP-CLIENT-CHANNEL-ID": `${appVersionID}`
|
"X-UP-CLIENT-CHANNEL-ID": `${appVersionID}`,
|
||||||
|
"appCode": "miguvideo_default_android"
|
||||||
}
|
}
|
||||||
// console.log(headers)
|
// console.log(headers)
|
||||||
const str = timestramp + pid + appVersion.substring(0, 8)
|
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 baseURL = "https://play.miguvideo.com/playurl/v1/play/playurl"
|
||||||
const params = "?sign=" + sign + "&rateType=" + rateType
|
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, {
|
const respData = await fetch(baseURL + params, {
|
||||||
headers: headers
|
headers: headers
|
||||||
}).then(r => r.json())
|
}).then(r => r.json())
|
||||||
@@ -157,6 +160,7 @@ async function getAndroidURL720p(pid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rateType = respData.body.urlInfo?.rateType
|
rateType = respData.body.urlInfo?.rateType
|
||||||
|
pid = respData.body.content.contId
|
||||||
|
|
||||||
// 将URL加密
|
// 将URL加密
|
||||||
const resURL = getddCalcuURL720p(url, pid)
|
const resURL = getddCalcuURL720p(url, pid)
|
||||||
|
|||||||
Reference in New Issue
Block a user