From 138dbf542fd81f883a5875f2db5fa085a58e7353 Mon Sep 17 00:00:00 2001 From: SummerTail <1525249038@qq.com> Date: Sun, 2 Jul 2023 00:18:16 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2Media?= =?UTF-8?q?Info=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router/index.js | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/router/index.js b/router/index.js index 2b16380..70c5569 100644 --- a/router/index.js +++ b/router/index.js @@ -5,22 +5,22 @@ const KoaSSEStream = require('koa-sse-stream'); const {dowload} = require("../util/download"); const {addDownList, getDownList, setDownState} = require("../util/sql/download"); const dayjs = require("dayjs") +const {getMediaInfo} = require("../util/utils"); const router = new Router() // const dowloadlist = [] -// router.get("/test", async (ctx) => { -// let url = ctx.query.url -// await utils.createTorrent(url,'C:\\Users\\SummerTail\\Downloads\\Video\\斗破苍穹.年番.Fights.Break.Sphere.S05E06.2022.2160p.WEB-DL.H265.AAC-ADWeb.torrent').then(value => { -// ctx.body = { -// code: 0, -// msg: "Test", -// data: value -// } -// }) - - - -// }) +router.get("/getMediaInfo", async (ctx) => { + let url = ctx.query.filePath + let data + await getMediaInfo(url).then(value => { + data = value; + }) + ctx.body = { + code: 0, + msg: "", + data: data + } +}) router.get("/getQqList", async (ctx) => { let url = ctx.query.url @@ -50,12 +50,11 @@ router.get("/startDown", async (ctx) => { } }) -router.get("/test",async (ctx)=>{ - utils.getVideoSpecifyTimeImage("D:/aaa/梦中的那片海/梦中的那片海 第01集.mp4",46,"D:/aaa/梦中的那片海/aaa.jpg") +router.get("/test", async (ctx) => { + utils.getVideoSpecifyTimeImage("D:/aaa/梦中的那片海/梦中的那片海 第01集.mp4", 46, "D:/aaa/梦中的那片海/aaa.jpg") }) - // 连接池 const clientList = []; // koa-sse-stream 配置