From ce408dce8ba551a3fd81d9b4493eafea61a87931 Mon Sep 17 00:00:00 2001 From: theluyuan <1162963624@qq.com> Date: Tue, 11 Jul 2023 20:52:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=8B=B1=E6=96=87=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/database.db | Bin 12288 -> 16384 bytes router/videoInfo.js | 30 ++++++++++++--- view/src/api/Video.js | 28 ++++++++++---- view/src/page/subscribe/addSubscribe.vue | 45 ++++++++++++++++++++--- 4 files changed, 86 insertions(+), 17 deletions(-) diff --git a/db/database.db b/db/database.db index e1d032fbade85803f61c8a52b8b23cd0ae7d5b34..1ebfb4b16fd95c5b147b6be8d1e6487b76351f6a 100644 GIT binary patch delta 372 zcmZojXlP)ZAT21tz`(!)#4x}yQO8(VfQJ$l1d&NW;`%@_$|_q2koU;`}@`VKE(`IVFiDsY(i-ej%>zu0aZZ zp*}u9(bNJYA^#At@Z?kcW}8oPdoY>_f*jhMO+SZ9N(2OX`Z@+hDtNm_DrhKWrYLFh Ra%lnscC!-SJ;g-|0sz>|Y%c%+ delta 74 zcmZo@U~EX3AT21uz`(!^#4x}zQO6i4s24B8%ge{W#C?*1`y`*zW{ +router.get("/search", async (ctx) => { let name = ctx.query.name ctx.body = await serach(name) }) @@ -17,15 +19,15 @@ router.get("/search",async (ctx)=>{ // ctx.body = info // }) -router.get("/searchVideo",async (ctx)=>{ +router.get("/searchVideo", async (ctx) => { let name = ctx.query.name ctx.body = await serach(name) }) -router.get("/getVideoInfo",async (ctx)=>{ +router.get("/getVideoInfo", async (ctx) => { let id = ctx.query.id - if(!id){ + if (!id) { ctx.body = "请传递id" return } @@ -33,4 +35,22 @@ router.get("/getVideoInfo",async (ctx)=>{ }) +router.post("/addSubscribe", async (ctx) => { + // console.log(ctx.request.body) + let data = ctx.request.body +}) + +router.get("/getImdbName", async (ctx) => { + let res = await axios.get(ctx.query.url, { + proxy: false, + headers:{ + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67" + } + }) + + // console.log(res.data) + let $ = cheerio.load(res.data) + ctx.body = $("h1").text() +}) + module.exports = router \ No newline at end of file diff --git a/view/src/api/Video.js b/view/src/api/Video.js index 1fa8c9b..7e3442a 100644 --- a/view/src/api/Video.js +++ b/view/src/api/Video.js @@ -1,16 +1,30 @@ -import { base } from "./base"; -export async function getVideoInfo(id){ - return await base.get("/videoInfo/getVideoInfo",{ - params:{ +import {base} from "./base"; + +export async function getVideoInfo(id) { + return await base.get("/videoInfo/getVideoInfo", { + params: { id } }) } -export async function searchVideo(name){ - return await base.get("/videoInfo/searchVideo",{ - params:{ +export async function searchVideo(name) { + return await base.get("/videoInfo/searchVideo", { + params: { name } }) } + + +export async function getImdbName(url) { + return await base.get("/videoInfo/getImdbName", { + params: { + url + } + }) +} + +export async function addSubscribe({name, desc, year, season, ep, url}) { + return await base.post("/videoInfo/addSubscribe", {name, desc, year, season, ep, url}) +} \ No newline at end of file diff --git a/view/src/page/subscribe/addSubscribe.vue b/view/src/page/subscribe/addSubscribe.vue index 3831ac3..3673a29 100644 --- a/view/src/page/subscribe/addSubscribe.vue +++ b/view/src/page/subscribe/addSubscribe.vue @@ -17,11 +17,26 @@ +
+ 英文名: + + 年份 + + 第几季 + + 开始集数 + + +
+
+ 地址: + +
@@ -31,14 +46,17 @@