From 128904cd3b9e6ecf7ee5a91564b0f0c67deb4530 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 3 Nov 2021 09:52:52 +0100 Subject: gkleen@sif: switch to yt-dlp --- user-profiles/mpv/default.nix | 6 ++++-- user-profiles/yt-dlp.nix | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 user-profiles/yt-dlp.nix (limited to 'user-profiles') diff --git a/user-profiles/mpv/default.nix b/user-profiles/mpv/default.nix index 642eb004..f8454508 100644 --- a/user-profiles/mpv/default.nix +++ b/user-profiles/mpv/default.nix @@ -8,8 +8,10 @@ config = { ytdl = true; ytdl-format = lib.concatStringsSep "/" [ - "bestvideo[width<=2560][height<=1440][fps<=60][protocol!=http_dash_segments]+bestaudio[protocol!=http_dash_segments]" - "best[width<=2560][height<=1440][fps<=60][protocol!=http_dash_segments]" + "bestvideo[width<=1920][height<=1080][fps<=60][protocol!=http_dash_segments]+bestaudio[protocol!=http_dash_segments]" + "best[width<=1920][height<=1080][fps<=60][protocol!=http_dash_segments]" + # "bestvideo[width<=2560][height<=1440][fps<=60][protocol!=http_dash_segments]+bestaudio[protocol!=http_dash_segments]" + # "best[width<=2560][height<=1440][fps<=60][protocol!=http_dash_segments]" "best[protocol!=http_dash_segments]" ]; ytdl-raw-options = lib.concatStringsSep "," [ diff --git a/user-profiles/yt-dlp.nix b/user-profiles/yt-dlp.nix new file mode 100644 index 00000000..946fd8d0 --- /dev/null +++ b/user-profiles/yt-dlp.nix @@ -0,0 +1,17 @@ +{ config, lib, userName, pkgs, ... }: +{ + home-manager.users.${userName} = { + home.packages = with pkgs; [ yt-dlp ]; + xdg.configFile."yt-dlp/config".text = '' + --netrc + --mark-watched + --format ${lib.concatStringsSep "/" [ + "bestvideo[width<=1920][height<=1080][fps<=60][protocol!=http_dash_segments]+bestaudio[protocol!=http_dash_segments]" + "best[width<=1920][height<=1080][fps<=60][protocol!=http_dash_segments]" + # "bestvideo[width<=2560][height<=1440][fps<=60][protocol!=http_dash_segments]+bestaudio[protocol!=http_dash_segments]" + # "best[width<=2560][height<=1440][fps<=60][protocol!=http_dash_segments]" + "best[protocol!=http_dash_segments]" + ]} + ''; + }; +} -- cgit v1.2.3