summaryrefslogtreecommitdiff
path: root/user-profiles/yt-dlp.nix
blob: fda29111424afdaa0845c8eeae7557bb9c20654e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ config, lib, userName, pkgs, ... }:
{
  home-manager.users.${userName} = {
    programs.yt-dlp = {
      enable = true;
      settings = {
        cookies-from-browser = "firefox::none";
        mark-watched = true;
        format = lib.concatStringsSep "/" [
          "bestvideo*[width<=3840][height<=2160][fps<=60]+bestaudio"
          "best[width<=3840][height<=2160][fps<=60]"
          "bestvideo*+bestaudio"
          "best"
        ];
        embed-subs = true;
        # write-subs = true;
        # write-auto-subs = true;
        sub-langs = "en(-(gb|us|orig))?,de(-(de|orig))?,-live_chat,-rechat";
        prefer-free-formats = true;
        embed-metadata = true;
        # downloader = "${pkgs.axel}/bin/axel";
        concurrent-fragments = 12;
        buffer-size = "16K";
        sponsorblock-mark = "all";
        # restrict-filenames = true;
        # extractor-args = lib.concatStringsSep ";" [
        #   "youtube:player-client=android,web"
        #   "youtube:formats=dashy"
        # ];
        remux-video = "mp4>mkv";
        hwdec = "auto-safe";
      };
    };
  };
}