🐞 fix: V1.6.6 修复downloadVideo函数出现缺陷问题

1. 修复`downloadVideo`函数在国内服务器的缺陷
2. 修复YouTube、tiktok在国内服务器无法使用问题
This commit is contained in:
zhiyu1998 2024-04-03 20:36:21 +08:00
parent c4eaf682c2
commit f9412d3c1d

View File

@ -731,7 +731,7 @@ export class tools extends plugin {
if (url && (url.endsWith(".jpg") || url.endsWith(".png"))) {
e.reply(segment.image(url));
} else {
this.downloadVideo(url).then(path => {
this.downloadVideo(url, !isOversea).then(path => {
e.reply(segment.video(path + "/temp.mp4"));
});
}
@ -1189,7 +1189,7 @@ export class tools extends plugin {
if (formats.length > 0) {
// 大概率是720p
const videoUrl = formats?.[formats.length - 1].url;
this.downloadVideo(videoUrl).then(path => {
this.downloadVideo(videoUrl, !isOversea).then(path => {
e.reply(segment.video(path + "/temp.mp4"));
});
}
@ -1549,7 +1549,7 @@ export class tools extends plugin {
httpAgent: tunnel.httpOverHttp({
proxy: { host: this.proxyAddr, port: this.proxyPort },
}),
httpsAgent: tunnel.httpOverHttp({
httpsAgent: tunnel.httpsOverHttp({
proxy: { host: this.proxyAddr, port: this.proxyPort },
}),
}),