ptSend/router/videoInfo.js
2023-07-04 21:38:26 +08:00

22 lines
449 B
JavaScript

const Router = require("koa-router")
const { route } = require(".")
const { serach, getinfo } = require("../util/ptgen")
const router = new Router({
prefix:"/videoInfo"
})
router.get("/search",async (ctx)=>{
let name = ctx.query.name
let info = await serach(name)
ctx.body = info
})
router.get("/getinfo",async (ctx)=>{
let url = ctx.query.url
let info = await getinfo(url)
ctx.body = info
})
module.exports = router