mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2026-03-22 10:15:50 +05:30
Compare commits
2 Commits
52dad3acb1
...
180d295062
@@ -259,7 +259,7 @@ export default function App({ children }: { children: React.ReactNode }) {
|
|||||||
try {
|
try {
|
||||||
const isFlatpak = await invoke<boolean>('is_flatpak');
|
const isFlatpak = await invoke<boolean>('is_flatpak');
|
||||||
const command = isFlatpak
|
const command = isFlatpak
|
||||||
? Command.create('yt-dlp', [' --version'])
|
? Command.create('sh', ['-c', `yt-dlp --version`])
|
||||||
: Command.sidecar('binaries/yt-dlp', ['--version']);
|
: Command.sidecar('binaries/yt-dlp', ['--version']);
|
||||||
const output = await command.execute();
|
const output = await command.execute();
|
||||||
if (output.code === 0) {
|
if (output.code === 0) {
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ export default function useDownloader() {
|
|||||||
|
|
||||||
const isFlatpak = await invoke<boolean>('is_flatpak');
|
const isFlatpak = await invoke<boolean>('is_flatpak');
|
||||||
const command = isFlatpak
|
const command = isFlatpak
|
||||||
? Command.create('yt-dlp', args)
|
? Command.create('sh', ['-c', `yt-dlp ${args.map(arg => `'${arg.replace(/'/g, "'\\''")}'`).join(' ')}`])
|
||||||
: Command.sidecar('binaries/yt-dlp', args);
|
: Command.sidecar('binaries/yt-dlp', args);
|
||||||
|
|
||||||
let jsonOutput = '';
|
let jsonOutput = '';
|
||||||
@@ -562,7 +562,7 @@ export default function useDownloader() {
|
|||||||
console.log('Starting download with args:', args);
|
console.log('Starting download with args:', args);
|
||||||
const isFlatpak = await invoke<boolean>('is_flatpak');
|
const isFlatpak = await invoke<boolean>('is_flatpak');
|
||||||
const command = isFlatpak
|
const command = isFlatpak
|
||||||
? Command.create('yt-dlp', args)
|
? Command.create('sh', ['-c', `yt-dlp ${args.map(arg => `'${arg.replace(/'/g, "'\\''")}'`).join(' ')}`])
|
||||||
: Command.sidecar('binaries/yt-dlp', args);
|
: Command.sidecar('binaries/yt-dlp', args);
|
||||||
|
|
||||||
command.on('close', async (data) => {
|
command.on('close', async (data) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user