]> Git — Sourcephile - julm/julm-nix.git/blob - home-manager/profiles/yt-dlp.nix
oignon: wireguard: remove in favor of nebula
[julm/julm-nix.git] / home-manager / profiles / yt-dlp.nix
1 { pkgs, lib, ... }:
2 {
3 imports = [
4 ./aria2c.nix
5 ];
6 home.packages = [
7 # error: phantomjs 1.9.8 has been dropped due to lack of maintenance and security issues
8 #pkgs.phantomjs
9 pkgs.yt-dlp
10 pkgs.ffmpeg
11 pkgs.podl
12 ];
13 programs.bash.shellAliases = {
14 yt = "yt-dlp";
15 yt-audio = "yt-dlp -f 'worstaudio[acodec=opus]/worstaudio'";
16 yt-subs = "yt-dlp --write-subs --write-auto-sub --skip-download";
17 yt-subs-fr = "yt-subs --sub-langs '-all,fr-orig,fr'";
18 };
19 xdg.configFile."yt-dlp/config".text = ''
20 #--download-archive .downloaded
21 --external-downloader aria2c
22 --embed-chapters
23 --embed-subs
24 --sub-langs all
25 --format-sort +res~480,+vcodec:av01,+acodec:opus
26 --format ${lib.concatStringsSep "/" [
27 "bestvideo+bestaudio"
28 "best"
29 ]}
30 --output "%(release_date>%Y-%m-%d,upload_date>%Y-%m-%d)s - %(title).150B.%(id)s.%(format_id)s.%(ext)s"
31 --match-filter !is_live
32 --prefer-free-formats
33 --sub-format ass/srt/best
34 --sub-langs "en.*,fr,-live_chat,-rechat"
35 --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0"
36 '';
37 }