mirror of
https://github.com/csd4ni3l/soundboard.git
synced 2026-03-10 09:09:24 +01:00
Fix yt-dlp binary not having the right permissions after download
This commit is contained in:
@@ -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{
|
||||||
|
|||||||
Reference in New Issue
Block a user