add 获取媒体豆瓣信息

This commit is contained in:
2023-07-05 20:36:42 +08:00
parent 302dff409e
commit 73a97a125c
10 changed files with 467 additions and 24 deletions

View File

@@ -1,6 +1,5 @@
const Router = require("koa-router")
const { route } = require(".")
const { serach, getinfo } = require("../util/ptgen")
const { serach, gen_douban } = require("../util/ptgen")
const router = new Router({
prefix:"/videoInfo"
@@ -13,10 +12,28 @@ router.get("/search",async (ctx)=>{
ctx.body = info
})
router.get("/getinfo",async (ctx)=>{
let url = ctx.query.url
let info = await getinfo(url)
// 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