dotfiles/home/programs/yt-dlp.nix

43 lines
1 KiB
Nix
Raw Normal View History

2023-12-13 23:29:09 +00:00
{ pkgs, config, lib, ... }:
2022-04-14 18:25:49 +00:00
{
2023-07-20 22:38:55 +00:00
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;
};
};
2022-08-01 10:24:30 +00:00
home.packages = with pkgs; [
2023-07-20 22:38:55 +00:00
aria2
2024-05-05 22:08:59 +00:00
rtmpdump
2022-08-01 10:24:30 +00:00
];
2022-04-14 18:25:49 +00:00
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 = ''
2023-12-13 23:29:09 +00:00
${lib.getExe config.programs.yt-dlp.package} --config-location "$HOME/.config/yt-dlp/config" --download-archive "$HOME/.config/yt-dlp/archive" $argv
'';
};
2022-04-14 18:25:49 +00:00
}