dnscrypt-proxy2: support nftables
[julm/julm-nix.git] / home-manager / profiles / yt-dlp.nix
index 5e0c528e05866c9ea93f5e4d4337b22897feffe9..1ebdc393709909c1d1e693c834011b776f8c5934 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-chapters
     --embed-subs
     --sub-langs all
+    --format-sort +res~480,+vcodec:av01,+acodec:opus
     --format ${lib.concatStringsSep "/" [
-      "bestvideo[height<=480][vcodec=av1]+bestaudio"
-      "bestvideo[height<=480][vcodec=vp9]+bestaudio"
-      "bestvideo[height<=480][ext=mp4]+bestaudio"
-      "bestvideo[height<=480]+bestaudio"
-
-      "best[height<=480][ext=av1]"
-      "best[height<=480][ext=vp9]"
-      "best[height<=480][ext=mp4]"
-      "best[height<=480]"
-
+      "bestvideo+bestaudio"
       "best"
     ]}
-    --output "%(release_date>%Y-%m-%d,upload_date>%Y-%m-%d)s - %(title)s.%(id)s.%(format_id)s.%(ext)s"
+    --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
     --sub-langs "en.*,fr,-live_chat,-rechat"
-    --user-agent Mozilla/5.0
+    --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0"
   '';
 }