mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2026-03-22 20:35:49 +05:30
fix: shell escaping of yt-dlp args on flatpak
This commit is contained in:
@@ -198,7 +198,7 @@ export default function useDownloader() {
|
||||
|
||||
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.create('sh', ['-c', `yt-dlp ${args.map(arg => `'${arg.replace(/'/g, "'\\''")}'`).join(' ')}`])
|
||||
: Command.sidecar('binaries/yt-dlp', args);
|
||||
|
||||
let jsonOutput = '';
|
||||
@@ -562,7 +562,7 @@ export default function useDownloader() {
|
||||
console.log('Starting download with args:', 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.create('sh', ['-c', `yt-dlp ${args.map(arg => `'${arg.replace(/'/g, "'\\''")}'`).join(' ')}`])
|
||||
: Command.sidecar('binaries/yt-dlp', args);
|
||||
|
||||
command.on('close', async (data) => {
|
||||
|
||||
Reference in New Issue
Block a user