add 获取视频文件 medaInfo 信息
This commit is contained in:
parent
fe815b455d
commit
d16f5264bf
@ -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,15 +10,24 @@ 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"){
|
||||
videoid = videoid[i + 1].replace(".html")
|
||||
for (let i in videoid) {
|
||||
if (videoid[i] == "cover") {
|
||||
videoid = videoid[i + 1].replace(".html")
|
||||
break
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user