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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user