dotfiles/home/programs/yt-dlp.nix
Daniel Kempkens 650be0e27e
All checks were successful
Update Flake / update-flake (push) Successful in 3m20s
Build / build-arm64-linux (push) Successful in 12m23s
Build / build-amd64-linux (push) Successful in 28s
chore: use lib.getExe in more places
2023-12-14 00:29:09 +01:00

41 lines
1 KiB
Nix

{ pkgs, config, lib, ... }:
{
programs.yt-dlp = {
enable = true;
settings = {
format = "'bestvideo+bestaudio/best'";
# Metadata
add-metadata = true;
embed-subs = true;
xattrs = true;
# Subtitles
write-sub = true;
sub-format = "best";
sub-lang = "en,de";
# Downloader
downloader = "aria2c";
downloader-args = "aria2c:'--async-dns=false --max-download-limit=6M --min-split-size=1M --max-connection-per-server=4 --split=4'";
# Other
no-overwrites = true;
no-call-home = true;
};
};
home.packages = with pkgs; [
aria2
];
programs.fish = {
shellAliases = {
ytdl = "ytdl_with_options";
ytdl_mp4 = "ytdl_with_options -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]'";
yti = "ytdl_with_options -F";
};
functions.ytdl_with_options = ''
${lib.getExe config.programs.yt-dlp.package} --config-location "$HOME/.config/yt-dlp/config" --download-archive "$HOME/.config/yt-dlp/archive" $argv
'';
};
}