添加vivid

This commit is contained in:
develop202
2025-12-22 14:00:25 +08:00
parent 2a4c9435a1
commit c0ce28f776
11 changed files with 7549 additions and 6454 deletions

View File

@@ -1,6 +1,7 @@
import { getStringMD5 } from "./EncryUtils.js";
import { getddCalcuURL, getddCalcuURL720p } from "./ddCalcuURL.js";
import { printDebug, printYellow } from "./colorOut.js";
import { fetchUrl } from "./net.js";
/**
* @typedef {object} SaltSign
@@ -67,20 +68,20 @@ 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 + "&timestamp=" + timestramp + "&salt=" + result.salt
+ "&flvEnable=true&super4k=true&h265N=true"
let respData = await fetch(baseURL + params, {
+ "&flvEnable=true&super4k=true&h265N=true&4kvivid=true&2Kvivid=true&vivid=2"
let respData = await fetchUrl(baseURL + params, {
headers: headers
}).then(r => r.json())
})
if (respData.rid == 'TIPS_NEED_MEMBER') {
printYellow("该账号没有会员 正在降低画质")
params = "?sign=" + result.sign + "&rateType=3"
+ "&contId=" + pid + "&timestamp=" + timestramp + "&salt=" + result.salt
+ "&flvEnable=true&super4k=true&h265N=true"
respData = await fetch(baseURL + params, {
+ "&flvEnable=true&super4k=true&h265N=true&4kvivid=true&2Kvivid=true&vivid=2"
respData = await fetchUrl(baseURL + params, {
headers: headers
}).then(r => r.json())
})
}
printDebug(respData)
@@ -144,9 +145,10 @@ async function getAndroidURL720p(pid) {
const baseURL = "https://play.miguvideo.com/playurl/v1/play/playurl"
const params = "?sign=" + sign + "&rateType=" + rateType
+ "&contId=" + pid + "&timestamp=" + timestramp + "&salt=" + salt + "&flvEnable=true"
const respData = await fetch(baseURL + params, {
+ "&flvEnable=true&super4k=true&h265N=true&4kvivid=true&2Kvivid=true&vivid=2"
const respData = await fetchUrl(baseURL + params, {
headers: headers
}).then(r => r.json())
})
printDebug(respData)
// console.dir(respData, { depth: null })

View File

@@ -1,4 +1,5 @@
import { userId } from "../config.js"
import { fetchUrl } from "./net.js"
import { getDateString } from "./time.js"
const list = {
@@ -70,7 +71,7 @@ function encrypt(videoURL, memoryView, getEncrypt) {
*/
async function initWasm(masmURL) {
// 获取wasm文件
let resp = await fetch(masmURL);
let resp = await fetchUrl(masmURL);
// 初始化
let { instance } = await WebAssembly.instantiateStreaming(resp, importObj)
return instance.exports;

View File

@@ -1,3 +1,4 @@
import { fetchUrl } from "./net.js"
function delay(ms) {
return new Promise(resolve => {
@@ -7,7 +8,7 @@ function delay(ms) {
// 获取分类集合
async function cateList() {
const resp = await fetch("https://program-sc.miguvideo.com/live/v2/tv-data/1ff892f2b5ab4a79be6e25b69d2f5d05").then(r => r.json())
const resp = await fetchUrl("https://program-sc.miguvideo.com/live/v2/tv-data/1ff892f2b5ab4a79be6e25b69d2f5d05")
let liveList = resp.body.liveList
// 热门内容重复
liveList = liveList.filter(item => {
@@ -30,7 +31,7 @@ async function dataList() {
for (let cate in cates) {
try {
const resp = await fetch("https://program-sc.miguvideo.com/live/v2/tv-data/" + cates[cate].vomsID).then(r => r.json())
const resp = await fetchUrl("https://program-sc.miguvideo.com/live/v2/tv-data/" + cates[cate].vomsID)
cates[cate].dataList = resp.body.dataList
} catch (error) {
cates[cate].dataList = [];

View File

@@ -1,5 +1,8 @@
import os from "os"
// const controller = new AbortController();
// const timeoutId = setTimeout(() => controller.abort(), 15000);
function getLocalIPv(ver = 4) {
const ips = []
const inter = os.networkInterfaces()
@@ -22,6 +25,15 @@ function getLocalIPv(ver = 4) {
return ips
}
export {
getLocalIPv
async function fetchUrl(url, opts = {}) {
// opts["signal"] = controller.signal
const res = await fetch(url, opts)
.then(r => r.json())
.catch(err => console.log(err))
// clearTimeout(timeoutId);
return res
}
export {
getLocalIPv, fetchUrl
}

View File

@@ -1,12 +1,13 @@
import { getDateString, getDateTimeString } from "./time.js"
import { appendFileSync } from "./fileUtil.js"
import { cntvNames } from "./datas.js"
import { fetchUrl } from "./net.js"
async function getPlaybackData(programId) {
const date = new Date()
const today = getDateString(date)
const resp = await fetch(`https://program-sc.miguvideo.com/live/v2/tv-programs-data/${programId}/${today}`).then(r => r.json())
const resp = await fetchUrl(`https://program-sc.miguvideo.com/live/v2/tv-programs-data/${programId}/${today}`)
return resp.body?.program[0]?.content
}
@@ -42,7 +43,7 @@ async function updatePlaybackDataByCntv(program, filePath) {
const date = new Date()
const today = getDateString(date)
const cntvName = cntvNames[program.name]
const resp = await fetch(`https://api.cntv.cn/epg/epginfo3?serviceId=shiyi&d=${today}&c=${cntvName}`).then(r => r.json())
const resp = await fetchUrl(`https://api.cntv.cn/epg/epginfo3?serviceId=shiyi&d=${today}&c=${cntvName}`)
const playbackData = resp[cntvName]?.program
if (!playbackData) {

View File

@@ -1,5 +1,5 @@
import { printDebug } from "./colorOut.js";
import { AESencrypt, getStringMD5, RSAencrypt } from "./EncryUtils.js"
import { fetchUrl } from "./net.js";
/**
* @param {string} str -
@@ -46,19 +46,22 @@ async function refreshToken(userId, token) {
const baseURL = "https://migu-app-umnb.miguvideo.com/login/token_refresh_migu_plus"
const params = `?clientId=27fb3129-5a54-45bc-8af1-7dc8f1155501&sign=${sign}&signType=RSA`
// 发送请求
const respResult = await fetch(baseURL + params, {
headers: headers,
method: "post",
body: data
}).then(r => r.json())
try {
// 发送请求
const respResult = await fetchUrl(baseURL + params, {
headers: headers,
method: "post",
body: data
})
// 处理响应结果
if (respResult.resultCode == "REFRESH_TOKEN_SUCCESS") {
// console.log(respResult)
return true
// 处理响应结果
if (respResult.resultCode == "REFRESH_TOKEN_SUCCESS") {
// console.log(respResult)
return true
}
console.dir(respResult, { depth: null })
} catch (error) {
}
console.dir(respResult, { depth: null })
return false
}