add 种子制作
This commit is contained in:
@@ -4,7 +4,8 @@ const { mkdirRecursions } = require('../markdir.js');
|
||||
const schedule = require('node-schedule');
|
||||
const { setDownState, getDownList } = require('../sql/download.js');
|
||||
const { getVideoInfo } = require('../sql/video.js');
|
||||
const fs = require("fs")
|
||||
const fs = require("fs");
|
||||
const { sendSeed } = require('../SendSeed/index.js');
|
||||
|
||||
// 小于10添加0
|
||||
function addZeor(num){
|
||||
@@ -36,7 +37,9 @@ async function reName(dinfo){
|
||||
}
|
||||
// 判断时长 0 为下载 1 下载完成 2 做种 3 没有下载完成或没有会员
|
||||
if(Video.Duration < 4 * 60){
|
||||
return 3
|
||||
return {
|
||||
state: 3
|
||||
}
|
||||
}
|
||||
let fbl = 0
|
||||
if(Video.Height > 3000){
|
||||
@@ -52,13 +55,33 @@ async function reName(dinfo){
|
||||
}else {
|
||||
fbl = 480
|
||||
}
|
||||
let rname = `[${vinfo.name}].${vinfo.rename}.${vinfo.year}.S${addZeor(vinfo.season)}E${addZeor(dinfo.title)}.WEB-DL.${fbl}p.${Video.Format}.${Audio.Format}.mp4`
|
||||
let rname = `[${vinfo.name}].${vinfo.rename}.${vinfo.year}.S${addZeor(vinfo.season)}E${addZeor(dinfo.title)}.WEB-DL.${fbl}p.${Video.Format}.${Audio.Format}@ZmWeb.mp4`
|
||||
let state = fs.renameSync(dinfo.save + "/" + dinfo.title + ".mp4",dinfo.save + "/" + rname)
|
||||
|
||||
let newPath = ""
|
||||
let tem = dinfo.save.split("/")
|
||||
tem.pop()
|
||||
let seedName = `[${vinfo.name}].${vinfo.rename}.${vinfo.year}.S${addZeor(vinfo.season)}.WEB-DL.${fbl}p.${Video.Format}.${Audio.Format}@ZmWeb`
|
||||
tem.push(seedName)
|
||||
newPath = tem.join("/")
|
||||
return {
|
||||
state: 1,
|
||||
info:{
|
||||
vid: dinfo.vid,
|
||||
oldPath: dinfo.save,
|
||||
newPath: newPath,
|
||||
seedName,
|
||||
title: `${vinfo.rename} ${vinfo.year} S${addZeor(vinfo.season)}Epxxx WEB-DL ${fbl}p ${Video.Format} ${Audio.Format}@ZmWeb`,
|
||||
Duration: Video.Duration,
|
||||
rname
|
||||
}
|
||||
}
|
||||
}else{
|
||||
console.log("未找到当前剧集信息")
|
||||
return{
|
||||
state: 0
|
||||
}
|
||||
}
|
||||
return 1
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -80,9 +103,11 @@ async function CheckDown(){
|
||||
if(exist){
|
||||
// 设置状态
|
||||
let s = await reName(dinfo)
|
||||
await setDownState(dinfo.id,1)
|
||||
await setDownState(dinfo.id,s.state)
|
||||
state = false
|
||||
|
||||
if(s.info){
|
||||
sendSeed(s.info)
|
||||
}
|
||||
}else{
|
||||
// 重新下载
|
||||
console.log("下载失败重新下载")
|
||||
|
||||
Reference in New Issue
Block a user