Fix yt-dlp binary not having the right permissions after download

This commit is contained in:
csd4ni3l
2026-03-05 21:41:08 +01:00
parent dff8d5aeff
commit 8d21c268c2

View File

@@ -1,4 +1,4 @@
use std::{env::current_dir, fs::{File, exists}, io, process::Command}; use std::{env::current_dir, fs::{File, exists}, io, os::unix::fs::PermissionsExt, process::Command};
use reqwest; use reqwest;
use rfd::{MessageButtons, MessageDialog, MessageDialogResult}; use rfd::{MessageButtons, MessageDialog, MessageDialogResult};
@@ -40,6 +40,8 @@ pub fn check_and_download_yt_dlp() {
let mut body = reqwest::blocking::get(url).expect("Could not download yt-dlp"); let mut body = reqwest::blocking::get(url).expect("Could not download yt-dlp");
let mut out = File::create(get_yt_dlp_path()).expect("failed to create file"); let mut out = File::create(get_yt_dlp_path()).expect("failed to create file");
io::copy(&mut body, &mut out).expect("failed to copy content"); io::copy(&mut body, &mut out).expect("failed to copy content");
out.set_permissions(PermissionsExt::from_mode(0o755));
} }
pub fn check_ffmpeg() -> bool{ pub fn check_ffmpeg() -> bool{