feat: 添加上传飞机劫持下载

This commit is contained in:
zhiyu1998 2024-08-25 21:20:27 +08:00
parent 7f318779ea
commit 042935e271

View File

@ -64,6 +64,7 @@ export async function saveTDL(url, isOversea, proxyAddr) {
* @returns {Promise<void>}
*/
export async function uploadTDL(filePath, isOversea, proxyAddr) {
return new Promise((resolve, reject) => {
const proxyStr = isOversea ? `` : `--proxy ${ proxyAddr }`;
const command = `tdl up -p ${ filePath } ${ proxyStr }`;
exec(command, (error, stdout, stderr) => {
@ -77,4 +78,5 @@ export async function uploadTDL(filePath, isOversea, proxyAddr) {
}
resolve(stdout);
})
})
}