1
1
mirror of https://github.com/neosubhamoy/neodlp.git synced 2026-03-22 16:05: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

@@ -21,7 +21,13 @@ export function useYtDlpUpdater() {
setIsUpdatingYtDlp(true);
LOG.info('NEODLP', 'Updating yt-dlp to latest version');
try {
const command = currentPlatform === 'linux' && !isFlatpak ? Command.create('pkexec', ['yt-dlp', '--update-to', ytDlpUpdateChannel]) : Command.sidecar('binaries/yt-dlp', ['--update-to', ytDlpUpdateChannel]);
const command = currentPlatform === 'linux' && isFlatpak
? ytDlpUpdateChannel === 'nightly'
? Command.create('sh', ['-c', 'pip3 install -U --pre "yt-dlp[default,curl-cffi]"'])
: Command.create('sh', ['-c', 'pip3 install -U "yt-dlp[default,curl-cffi]"'])
: currentPlatform === 'linux'
? Command.create('pkexec', ['yt-dlp', '--update-to', ytDlpUpdateChannel])
: Command.sidecar('binaries/yt-dlp', ['--update-to', ytDlpUpdateChannel]);
const output = await command.execute();
if (output.code === 0) {
console.log("yt-dlp updated successfully:", output.stdout);