ptSend/router/videoInfo.js

39 lines
761 B
JavaScript

const Router = require("koa-router")
const { serach, gen_douban } = 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
// })
router.get("/serchVideo",async (ctx)=>{
let name = ctx.query.name
let info = await serach(name)
ctx.body = info
})
router.get("/getVideoInfo",async (ctx)=>{
let id = ctx.query.id
if(!id){
ctx.body = "请传递id"
return
}
let info = await gen_douban(id)
ctx.body = info
})
module.exports = router