ytdl: Use HM module to configure
This commit is contained in:
parent
0555800f5b
commit
20441e467b
2 changed files with 25 additions and 29 deletions
|
@ -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
|
|
@ -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; [
|
||||
aria2
|
||||
atomicparsley
|
||||
rtmpdump
|
||||
yt-dlp
|
||||
];
|
||||
|
||||
xdg.configFile.yt-dlp = {
|
||||
source = ../config/yt-dlp;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
programs.fish = {
|
||||
shellAliases = {
|
||||
ytdl = "ytdl_with_options";
|
||||
|
@ -20,7 +37,7 @@
|
|||
};
|
||||
|
||||
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
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue