1
1
mirror of https://github.com/neosubhamoy/neodlp.git synced 2026-03-22 18:15:50 +05:30

refactor: use pip3 yt-dlp in flatpak

This commit is contained in:
2026-03-05 21:35:30 +05:30
Verified
parent 2e6dc6ab25
commit d7f2f7b867
5 changed files with 25 additions and 11 deletions

View File

@@ -196,7 +196,10 @@ export default function useDownloader() {
}
}
const command = Command.sidecar('binaries/yt-dlp', args);
const isFlatpak = await invoke<boolean>('is_flatpak');
const command = isFlatpak
? Command.create('sh', ['-c', `yt-dlp ${args.map(arg => arg.includes(' ') ? `"${arg}"` : arg).join(' ')}`])
: Command.sidecar('binaries/yt-dlp', args);
let jsonOutput = '';
@@ -557,7 +560,10 @@ export default function useDownloader() {
}
console.log('Starting download with args:', args);
const command = Command.sidecar('binaries/yt-dlp', args);
const isFlatpak = await invoke<boolean>('is_flatpak');
const command = isFlatpak
? Command.create('sh', ['-c', `yt-dlp ${args.map(arg => arg.includes(' ') ? `"${arg}"` : arg).join(' ')}`])
: Command.sidecar('binaries/yt-dlp', args);
command.on('close', async (data) => {
if (data.code !== 0) {