Update tools.js

修改油管解析,使其能直接播放
This commit is contained in:
MiX1024 2024-04-21 21:16:28 +08:00 committed by GitHub
parent 39e2f30061
commit d928a50aa0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1149,7 +1149,7 @@ export class tools extends plugin {
*/
async dy2b(path,url) {
return new Promise((resolve, reject) => {
const command = `yt-dlp ${isOversea ? "" : `--proxy ${this.myProxy}`} -P ${path} -o "temp.%(ext)s" -f 'bv[height<=720][ext=mp4]+ba[ext=m4a]' --merge-output-format "mp4" ${url}`;
const command = `yt-dlp ${isOversea ? "" : `--proxy ${this.myProxy}`} -P ${path} -o "temp.%(ext)s" -f 'best[height<=720][ext=mp4]' --merge-output-format "mp4" ${url}`;
exec(command, (error, stdout) => {
if (error) {
console.error(`Error executing command: ${error}`);
@ -1163,7 +1163,7 @@ export class tools extends plugin {
}
async sy2b(e){
let videoSizeLimit = 15
let videoSizeLimit = 30
const isOversea = await this.isOverseasServer();
if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) {
e.reply("检测到没有梯子,无法解析油管");