add 获取视频文件 medaInfo 信息

This commit is contained in:
SummerTail 2023-06-30 22:56:45 +08:00
parent fe815b455d
commit d16f5264bf

View File

@ -1,6 +1,6 @@
const Router = require("koa-router")
const {getQqListData} = require("../util/getList/qq")
const {getVideoTotalLength} = require("../util/utils")
const utils = require("../util/utils")
const KoaSSEStream = require('koa-sse-stream');
const {dowload} = require("../util/download");
const {addDownList, getDownList, setDownState} = require("../util/sql/download");
@ -10,14 +10,23 @@ const router = new Router()
router.get("/test", async (ctx) => {
let url = ctx.query.url
ctx.body = getVideoTotalLength(url)
await utils.getMediaInfo(url).then(value => {
ctx.body = {
code: 0,
msg: "Test",
data: value
}
})
})
router.get("/getQqList", async (ctx) => {
let url = ctx.query.url
let videoid = url.split("/")
for(let i in videoid){
if(videoid[i] == "cover"){
for (let i in videoid) {
if (videoid[i] == "cover") {
videoid = videoid[i + 1].replace(".html")
break
}