mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🎈 pref: 修复dy2b
迁移后导致的问题
This commit is contained in:
parent
d54251e089
commit
84ca256183
@ -1369,7 +1369,7 @@ export class tools extends plugin {
|
|||||||
await checkAndRemoveFile(path + "/temp.mp4")
|
await checkAndRemoveFile(path + "/temp.mp4")
|
||||||
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 dy2b(path, url, isOversea);
|
await dy2b(path, url, isOversea, this.myProxy);
|
||||||
this.sendVideoToUpload(e, `${ path }/temp.mp4`);
|
this.sendVideoToUpload(e, `${ path }/temp.mp4`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
* @param url 下载链接
|
* @param url 下载链接
|
||||||
* @param isOversea 是否是海外用户
|
* @param isOversea 是否是海外用户
|
||||||
*/
|
*/
|
||||||
export async function dy2b(path, url, isOversea) {
|
export async function dy2b(path, url, isOversea, proxy) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const command = `yt-dlp ${ isOversea ? "" : `--proxy ${ this.myProxy }` } -P ${ path } -o "temp.%(ext)s" --merge-output-format "mp4" ${ url }`;
|
const command = `yt-dlp ${ isOversea ? "" : `--proxy ${ proxy }` } -P ${ path } -o "temp.%(ext)s" --merge-output-format "mp4" ${ url }`;
|
||||||
exec(command, (error, stdout) => {
|
exec(command, (error, stdout) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(`Error executing command: ${ error }`);
|
console.error(`Error executing command: ${ error }`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user