1
0
Fork 0

ytdl: Use HM module to configure

This commit is contained in:
Daniel Kempkens 2023-07-21 00:38:55 +02:00
parent 0555800f5b
commit 20441e467b
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
2 changed files with 25 additions and 29 deletions

View file

@ -1,21 +0,0 @@
# Add metadata and other things to the video
--add-metadata
--embed-subs
#--embed-thumbnail
--xattrs
# Prefer best mp4 video
-f 'bestvideo+bestaudio/best'
# Subtitles
--write-sub
--sub-format best
--sub-lang en,de
# Download using aria2
--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
--no-call-home

View file

@ -1,17 +1,34 @@
{ pkgs, ... }: { pkgs, config, ... }:
{ {
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; [ home.packages = with pkgs; [
aria2
atomicparsley atomicparsley
rtmpdump rtmpdump
yt-dlp
]; ];
xdg.configFile.yt-dlp = {
source = ../config/yt-dlp;
recursive = true;
};
programs.fish = { programs.fish = {
shellAliases = { shellAliases = {
ytdl = "ytdl_with_options"; ytdl = "ytdl_with_options";
@ -20,7 +37,7 @@
}; };
functions.ytdl_with_options = '' functions.ytdl_with_options = ''
yt-dlp --config-location "$HOME/.config/yt-dlp/config" --download-archive "$HOME/.config/yt-dlp/archive" $argv ${config.programs.yt-dlp.package}/bin/yt-dlp --config-location "$HOME/.config/yt-dlp/config" --download-archive "$HOME/.config/yt-dlp/archive" $argv
''; '';
}; };
} }