mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
✨ feat: 添加上传飞机
劫持下载
This commit is contained in:
parent
7f318779ea
commit
042935e271
@ -64,6 +64,7 @@ export async function saveTDL(url, isOversea, proxyAddr) {
|
|||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
export async function uploadTDL(filePath, isOversea, proxyAddr) {
|
export async function uploadTDL(filePath, isOversea, proxyAddr) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
const proxyStr = isOversea ? `` : `--proxy ${ proxyAddr }`;
|
const proxyStr = isOversea ? `` : `--proxy ${ proxyAddr }`;
|
||||||
const command = `tdl up -p ${ filePath } ${ proxyStr }`;
|
const command = `tdl up -p ${ filePath } ${ proxyStr }`;
|
||||||
exec(command, (error, stdout, stderr) => {
|
exec(command, (error, stdout, stderr) => {
|
||||||
@ -77,4 +78,5 @@ export async function uploadTDL(filePath, isOversea, proxyAddr) {
|
|||||||
}
|
}
|
||||||
resolve(stdout);
|
resolve(stdout);
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user