add 打包发布

This commit is contained in:
2023-08-08 20:16:09 +08:00
parent b675e3033d
commit 007c76ccd3
4 changed files with 51 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
const fs = require("fs")
const { getMediaState } = require("../sql/download.js");
const { getMediaState, getDownEp } = require("../sql/download.js");
const path = require("path");
const { cwd } = require("process");
const { createTorrent, getVideoSpecifyTimeImage, uploadImg, getMediaInfoSend, deleteFolder, moveDir } = require("../utils.js");
@@ -16,11 +16,17 @@ async function updateSeed(info, desc) {
let vinfo = await getVideoInfo(info.vid)
let form = new FormData()
form.append('file', fs.createReadStream(path.join(cwd(), "/tmp/torrent/" + info.seedName.replace(" ",".") + ".torrent")))
form.append("name", info.title.replace("Epxxx", "E" + info.ep))
let ep = await getDownEp(info.vid)
if(ep.start == ep.end){
form.append("name", info.title.replace("Epxxx", "E" + info.ep))
}else{
form.append("name", info.title.replace("Epxxx", "E" + ep.start + "-" + "E" + ep.end))
}
form.append("small_descr", vinfo.subtitle)
form.append("url", vinfo.imdb)
form.append("descr", desc)
form.append("type", vinfo.type)
form.append("pt_gen", 'https://movie.douban.com/subject/' + vinfo.vid + "/")
let tags = vinfo.tags.split(",")
for (let i of tags) {
form.append("tags[4][]", i)