mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
🐞 fix: V1.3.1 修复油管解析bug
This commit is contained in:
parent
df30b619ca
commit
debecdc124
@ -166,7 +166,7 @@ YouTube解析参考了:[yt-dlp:A youtube-dl fork with additional features and
|
||||
|
||||
| 昵称 | 赞助 |
|
||||
|:---------------:|------|
|
||||
| 为爱发巅 | 1杯瑞幸 |
|
||||
| 为爱发巅 | 1杯瑞幸 |
|
||||
| 丘丘莹 | 5 |
|
||||
| Allweknow | 1杯瑞幸 |
|
||||
| MNJv | 5 |
|
||||
@ -175,6 +175,7 @@ YouTube解析参考了:[yt-dlp:A youtube-dl fork with additional features and
|
||||
| 左轮(ps. 我导师,泪目!) | 1杯瑞幸 |
|
||||
| mitsuha | 1杯瑞幸 |
|
||||
| [Kr] 5s¹ | 1杯瑞幸 |
|
||||
| 春日野穹OvO | 25 |
|
||||
|
||||
## 🚀 声明
|
||||
* 文件借鉴了很多插件,精简个人认为可以精简的内容。
|
||||
|
@ -988,15 +988,18 @@ export class tools extends plugin {
|
||||
// 下载地址格式化
|
||||
const path = `${ v }${ p ? `/p${ p }` : '' }`;
|
||||
const fullpath = `${ this.defaultPath }${ this.e.group_id || this.e.user_id }/${ path }`;
|
||||
// 创建下载文件夹
|
||||
await mkdirIfNotExists(fullpath);
|
||||
// yt-dlp下载
|
||||
let cmd = //`cd '${__dirname}' && (cd tmp > /dev/null || (mkdir tmp && cd tmp)) &&` +
|
||||
`yt-dlp ${ this.y2bCk !== undefined ? `--cookies ${ this.y2bCk }` : '' } https://youtu.be/${ v } -f ${ format.replace('x', '+') } ` +
|
||||
`yt-dlp ${ this.y2bCk !== undefined ? `--cookies ${ this.y2bCk }` : '' } ${url} -f ${ format.replace('x', '+') } ` +
|
||||
`-o '${ fullpath }/${ v }.%(ext)s' ${ isProxy ? `--proxy ${ this.proxyAddr }:${ this.proxyPort }` : '' } -k --write-info-json`;
|
||||
logger.info(cmd)
|
||||
try {
|
||||
await child_process.execSync(cmd);
|
||||
e.reply(segment.video(`${ fullpath }/${ v }.mp4`))
|
||||
// 清理文件
|
||||
await deleteFolderRecursive(fullpath);
|
||||
// await deleteFolderRecursive(`${ fullpath.split('\/').slice(0, -2).join('/') }`);
|
||||
} catch (error) {
|
||||
logger.error(error.toString());
|
||||
e.reply("y2b下载失败");
|
||||
|
Loading…
x
Reference in New Issue
Block a user