{ config, lib, ... }: let cfg = config.hm.soft.yt-dlp; in { options.hm.soft.yt-dlp.enable = lib.mkEnableOption "youtube content downloading tool"; config = lib.mkIf cfg.enable { programs.yt-dlp = { enable = true; settings = { format = "bestvideo+bestaudio/best"; merge-output-format = "webm"; prefer-free-formats = true; paths = "~/dl/yt"; output = "\"%(uploader)s - %(title)s.%(ext)s\""; download-archive = "~/.config/yt-dlp/archive.txt"; # restrict-filenames = true; embed-subs = true; sub-langs = "en.*"; embed-metadata = true; embed-chapters = true; }; }; }; }