home-manager: update
[julm/julm-nix.git] / home-manager / profiles / yt-dlp.nix
index 9d1f5c88b128da69fc6c33a753d731551d89bc22..65251c2fed7ddbd07d62469b9de02fac3267333e 100644 (file)
@@ -7,10 +7,14 @@
     # error: phantomjs 1.9.8 has been dropped due to lack of maintenance and security issues
     #pkgs.phantomjs
     pkgs.yt-dlp
+    pkgs.ffmpeg
+    pkgs.podl
   ];
   programs.bash.shellAliases = {
     yt = "yt-dlp";
     yt-audio = "yt-dlp -f 'worstaudio[acodec=opus]/worstaudio'";
+    yt-subs = "yt-dlp --write-subs --write-auto-sub --skip-download";
+    yt-subs-fr = "yt-subs --sub-langs '-all,fr-orig,fr'";
   };
   xdg.configFile."yt-dlp/config".text = ''
     #--download-archive .downloaded
     --embed-subs
     --sub-langs all
     --format-sort +res~480,+vcodec:av01,+acodec:opus
-    --format ${lib.concatStringsSep "/" [
-      "bestvideo+bestaudio"
-      "best"
-    ]}
-    --output "%(release_date>%Y-%m-%d,upload_date>%Y-%m-%d)s - %(title)s.%(id)s.%(format_id)s.%(ext)s"
+    --format ${
+      lib.concatStringsSep "/" [
+        "bestvideo+bestaudio"
+        "best"
+      ]
+    }
+    --output "%(release_date>%Y-%m-%d,upload_date>%Y-%m-%d)s - %(title).150B.%(id)s.%(format_id)s.%(ext)s"
     --match-filter !is_live
     --prefer-free-formats
     --sub-format ass/srt/best