mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🐞 fix: 修复ytb出现的限制大小bug
This commit is contained in:
parent
ca4c81f2a6
commit
426e01bede
@ -1340,7 +1340,6 @@ export class tools extends plugin {
|
|||||||
|
|
||||||
// 油管解析
|
// 油管解析
|
||||||
async sy2b(e) {
|
async sy2b(e) {
|
||||||
let videoSizeLimit = 30
|
|
||||||
const isOversea = await this.isOverseasServer();
|
const isOversea = await this.isOverseasServer();
|
||||||
if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) {
|
if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) {
|
||||||
e.reply("检测到没有梯子,无法解析油管");
|
e.reply("检测到没有梯子,无法解析油管");
|
||||||
@ -1360,7 +1359,7 @@ export class tools extends plugin {
|
|||||||
const title = execSync(`yt-dlp --get-title ${url} ${isOversea ? "" : `--proxy ${this.myProxy}`}`)
|
const title = execSync(`yt-dlp --get-title ${url} ${isOversea ? "" : `--proxy ${this.myProxy}`}`)
|
||||||
e.reply(`识别:油管,视频下载中请耐心等待 \n${title}`);
|
e.reply(`识别:油管,视频下载中请耐心等待 \n${title}`);
|
||||||
await this.dy2b(path, url, isOversea);
|
await this.dy2b(path, url, isOversea);
|
||||||
this.sendVideoToUpload(e, `${path}/temp.mp4`, videoSizeLimit)
|
this.sendVideoToUpload(e, `${ path }/temp.mp4`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
throw error; // Rethrow the error so it can be handled by the caller
|
throw error; // Rethrow the error so it can be handled by the caller
|
||||||
@ -2101,7 +2100,9 @@ export class tools extends plugin {
|
|||||||
return e.reply('视频不存在');
|
return e.reply('视频不存在');
|
||||||
}
|
}
|
||||||
const stats = fs.statSync(path);
|
const stats = fs.statSync(path);
|
||||||
const videoSize = (stats.size / (1024 * 1024)).toFixed(2);
|
const videoSize = Math.floor(stats.size / (1024 * 1024));
|
||||||
|
logger.info(typeof videoSize);
|
||||||
|
logger.info(typeof videoSizeLimit);
|
||||||
if (videoSize > videoSizeLimit) {
|
if (videoSize > videoSizeLimit) {
|
||||||
e.reply(`当前视频大小:${ videoSize }MB,\n大于设置的最大限制,\n改为上传群文件`);
|
e.reply(`当前视频大小:${ videoSize }MB,\n大于设置的最大限制,\n改为上传群文件`);
|
||||||
await this.uploadGroupFile(e, path);
|
await this.uploadGroupFile(e, path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user