bash: add mkpass()
[julm/julm-nix.git] / home-manager / profiles / yt-dlp.nix
index a6a41438758c5409cfb5ceec5c86a7379492a189..c0c90fc96d7769a5b3eba2b2f9532f0f244ecda4 100644 (file)
@@ -1,24 +1,34 @@
-{ pkgs, lib, config, ... }:
+{ pkgs, lib, ... }:
 {
-imports = [
-  ./aria2c.nix
-];
-home.packages = [
-  pkgs.phantomjs
-  pkgs.yt-dlp
-];
-xdg.configFile."yt-dlp/config".text = ''
-  #--download-archive .downloaded
-  --format ${lib.concatStringsSep "/" [
-    #"bestvideo[height=360][ext=mp4]+bestaudio"
-    "bestvideo[height=480][ext=mp4]+bestaudio"
-    #"best[height=360][ext=mp4]"
-    "best[height=480][ext=mp4]"
-    #"best[height=360]"
-    "best[height=480]"
-    "best"
-  ]}
-  --output "%(upload_date>%Y-%m-%d)s - %(title)s.%(id)s.%(format_id)s.%(ext)s"
-  --prefer-free-formats
-'';
+  imports = [
+    ./aria2c.nix
+  ];
+  home.packages = [
+    # error: phantomjs 1.9.8 has been dropped due to lack of maintenance and security issues
+    #pkgs.phantomjs
+    pkgs.yt-dlp
+  ];
+  xdg.configFile."yt-dlp/config".text = ''
+    #--download-archive .downloaded
+    --embed-chapters
+    --embed-subs
+    --sub-langs all
+    --format ${lib.concatStringsSep "/" [
+      "bestvideo[height=480][ext=mp4]+bestaudio"
+      "bestvideo[height=480]+bestaudio"
+      "bestvideo[height<=480][ext=mp4]+bestaudio"
+      "bestvideo[height<=480]+bestaudio"
+      "best[height=480][ext=mp4]"
+      "best[height=480]"
+      "best[height<=480][ext=mp4]"
+      "best[height<=480]"
+      "best"
+    ]}
+    --output "%(release_date>%Y-%m-%d,upload_date>%Y-%m-%d)s - %(title)s.%(id)s.%(format_id)s.%(ext)s"
+    --match-filter !is_live
+    --prefer-free-formats
+    --sub-format ass/srt/best
+    --sub-langs "en.*,fr,-live_chat,-rechat"
+    --user-agent Mozilla/5.0
+  '';
 }