ptSend/router/videoInfo.js

22 lines
449 B
JavaScript
Raw Normal View History

2023-06-20 22:34:27 +08:00
const Router = require("koa-router")
const { route } = require(".")
const { serach, getinfo } = require("../util/douban")
const router = new Router({
prefix:"/videoInfo"
})
router.get("/search",async (ctx)=>{
let name = ctx.query.name
let info = await serach(name)
ctx.body = info
})
route.get("/getinfo",async (ctx)=>{
let url = ctx.query.url
let info = await getinfo(url)
ctx.body = info
})
module.exports = router