This commit is contained in:
Theluyuan 2023-07-12 16:21:57 +08:00
parent 213130a207
commit a9428fe8ce
4 changed files with 97 additions and 78 deletions

Binary file not shown.

View File

@ -38,6 +38,7 @@ 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) => {

6
util/sql/video.js Normal file
View File

@ -0,0 +1,6 @@
const { run, getAll } = require("./base");
function addSub(info){
let sql = `insert into download(name,rename,skip,desc,url,subtitle,img) values(?,?,?,?,?,?)`
}

View File

@ -3,7 +3,7 @@
<div>
<div class="list">
<div class="item" v-for="i in list">
<el-card @click="getInfo(i.id)" shadow="hover" :body-style="{ padding: '0px' }">
<el-card @click="getInfo(i.id,i.img)" shadow="hover" :body-style="{ padding: '0px' }">
<img :src="i.img" class="image"/>
<div style="padding: 14px">
<span>{{ i.title }}({{ i.year }})</span>
@ -28,6 +28,10 @@
<el-input style="width: 100px" v-model="ep"></el-input>
</div>
<div style="display: flex;align-items: center;padding: 5px">
副标题:
<el-input style="width: 80%" v-model="subtitle"></el-input>
</div>
<div style="display: flex;align-items: center;padding: 5px">
地址:
<el-input style="width: 80%" v-model="url"></el-input>
@ -57,6 +61,8 @@ const year = ref("")
const ep = ref(1)
const season = ref(1)
const url = ref("")
const subtitle = ref("")
const img = ref("")
async function onSubmit(name) {
let res = await searchVideo(name)
list.value = res.data.data
@ -73,17 +79,21 @@ let vid = "";
const dialogFormVisible = ref(false)
async function getInfo(id) {
async function getInfo(id,i) {
const loadingInstance = ElLoading.service({fullscreen: true})
vid = id
img.value = i
let res = await getVideoInfo(id)
info.value = res.data.format
year.value = res.data.year
subtitle.value = res.data.trans_title.join(" / ")
await subscribe(res.data.imdb_link)
dialogFormVisible.value = true
loadingInstance.close()
}
const enName = ref("")
async function subscribe(url) {
const res = await getImdbName(url)
enName.value = res.data
@ -96,7 +106,9 @@ async function addsubscribe() {
year: year.value,
season: season.value,
ep: ep.value,
url:url.value
url: url.value,
img:img.value,
subtitle:subtitle.value
})
}