add 获取视频文件 medaInfo 信息
This commit is contained in:
parent
fe815b455d
commit
d16f5264bf
@ -1,6 +1,6 @@
|
|||||||
const Router = require("koa-router")
|
const Router = require("koa-router")
|
||||||
const {getQqListData} = require("../util/getList/qq")
|
const {getQqListData} = require("../util/getList/qq")
|
||||||
const {getVideoTotalLength} = require("../util/utils")
|
const utils = require("../util/utils")
|
||||||
const KoaSSEStream = require('koa-sse-stream');
|
const KoaSSEStream = require('koa-sse-stream');
|
||||||
const {dowload} = require("../util/download");
|
const {dowload} = require("../util/download");
|
||||||
const {addDownList, getDownList, setDownState} = require("../util/sql/download");
|
const {addDownList, getDownList, setDownState} = require("../util/sql/download");
|
||||||
@ -10,15 +10,24 @@ const router = new Router()
|
|||||||
|
|
||||||
router.get("/test", async (ctx) => {
|
router.get("/test", async (ctx) => {
|
||||||
let url = ctx.query.url
|
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) => {
|
router.get("/getQqList", async (ctx) => {
|
||||||
let url = ctx.query.url
|
let url = ctx.query.url
|
||||||
let videoid = url.split("/")
|
let videoid = url.split("/")
|
||||||
for(let i in videoid){
|
for (let i in videoid) {
|
||||||
if(videoid[i] == "cover"){
|
if (videoid[i] == "cover") {
|
||||||
videoid = videoid[i + 1].replace(".html")
|
videoid = videoid[i + 1].replace(".html")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user