Skip to content

Commit 23463e9

Browse files
committed
add ytdl-sub
1 parent 8f627d9 commit 23463e9

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

flake.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
inputs = {
33
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
4+
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
45
deploy-sh.url = "github:Defelo/deploy-sh";
56
sops-nix.url = "github:Mic92/sops-nix";
67
nfnix.url = "github:Defelo/nfnix";

hosts/prod/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
./nginx.nix
1111
./restic.nix
1212
./wireguard.nix
13+
./youtube-downloads.nix
1314
];
1415

1516
filesystems.defaultLayout = true;

hosts/prod/youtube-downloads.nix

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{nixpkgs-unstable, ...}: {
2+
imports = ["${nixpkgs-unstable}/nixos/modules/services/misc/ytdl-sub.nix"];
3+
4+
services.sshfs.mounts."/mnt/youtube" = {
5+
host = "u381435.your-storagebox.de";
6+
port = 23;
7+
user = "u381435";
8+
path = "youtube";
9+
readOnly = false;
10+
allowOther = true;
11+
};
12+
13+
services.ytdl-sub.instances.default = {
14+
enable = true;
15+
schedule = null; # TODO
16+
17+
config = {
18+
presets."YouTube Playlist" = {
19+
preset = ["Max 480p"]; # TODO
20+
download = "{subscription_value}";
21+
output_options = {
22+
output_directory = "/mnt/youtube";
23+
file_name = "{subscription_name}/{playlist_index_padded}_{%sanitize(title)}.{ext}";
24+
maintain_download_archive = true;
25+
};
26+
ytdl_options = {
27+
cookiefile = "/var/lib/ytdl-sub/default/.cookies";
28+
};
29+
};
30+
};
31+
32+
subscriptions."YouTube Playlist" = {
33+
rust = "https://www.youtube.com/playlist?list=PLNmsVeXQZj7r4HuTyVCDLKlsD9EQzoncP";
34+
quantencomputer = "https://www.youtube.com/playlist?list=PLNmsVeXQZj7qS21FP5tk1QqmeAmd2hpQF";
35+
clean_code = "https://www.youtube.com/playlist?list=PLNmsVeXQZj7ryyZikMDPxxyYxEKtKn0ji";
36+
};
37+
};
38+
39+
systemd.services.ytdl-sub-default.serviceConfig.ReadWritePaths = ["/mnt/youtube"];
40+
}

0 commit comments

Comments
 (0)