From abe078a914defcd89c21315c936d53cae586f29f Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sun, 10 Oct 2021 14:43:59 +0200 Subject: [PATCH] ytcc: Prefer newer video codecs --- users/simon/modules/ytcc.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/users/simon/modules/ytcc.nix b/users/simon/modules/ytcc.nix index 4b07946..2003b31 100644 --- a/users/simon/modules/ytcc.nix +++ b/users/simon/modules/ytcc.nix @@ -1,5 +1,12 @@ { lib, pkgs, ... }: - +let + ytdl-format = map (vc: "bestvideo[vcodec^=${vc}][width<=1920]+bestaudio[acodec^=opus]") [ "av01" "vp9" "avc1" ] + ++ [ + "bestvideo+bestaudio[acodec^=opus]" + "bestvideo+bestaudio" + "best" + ]; +in { xdg.configFile."ytcc/ytcc.conf".text = lib.generators.toINI { } { ytcc = { @@ -8,7 +15,7 @@ "--volume=90" "--profile=clear-speed" "--ytdl" - "--ytdl-format=bestvideo[vcodec^=avc1][width<=1920][fps<=30]+bestaudio[acodec^=opus]/bestvideo+bestaudio/best" + "--ytdl-format=${lib.concatStringsSep "/" ytdl-format}" ]; };