1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-03-07 11:39:55 +01:00

refactor: rename youtube downloader to ytdlp

More generic name since yt-dlp supports many sites beyond YouTube.
This commit is contained in:
TheGeneralist 2026-01-21 20:29:16 +01:00
parent 955a5037e9
commit 60727c0f1e
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
2 changed files with 5 additions and 3 deletions

View file

@ -1 +1,2 @@
pub mod youtube;
pub mod local;
pub mod ytdlp;

View file

@ -4,12 +4,13 @@ use std::{env, path::Path, process::Command};
use crate::hash::hash_file;
pub fn download(path: String, store_path: &Path, timestamp: &String) -> Result<String> {
println!("Downloading from YouTube: {path}");
println!("Downloading with yt-dlp: {path}");
let ytdlp = env::var("ARCHIVR_YT_DLP").unwrap_or_else(|_| "yt-dlp".to_string());
let temp_dir = store_path.join("temp");
let temp_dir = store_path.join("temp").join(timestamp);
std::fs::create_dir_all(&temp_dir)?;
let out_file = temp_dir.join(format!("{timestamp}.mp4"));
let out = Command::new(&ytdlp)