1amends "../../config/Service.pkl"
2
3import "../../config/site.pkl" as site
4
5local passive = site.preview || site.mediaReadOnly
6
7name = "YTDL"
8
9requiredSecrets {
10 "smtp_host"
11 "smtp_user"
12 "smtp_pass"
13}
14
15containers {
16 ["thumbnails"] {
17 build = "upscaler"
18 cpu = if (passive) 200 else 1000
19 memory = if (passive) 512 else 2048
20 entrypoint = if (passive) "/bin/sh" else null
21 args = if (passive) new {
22 "-c"
23 "python3 /app/upscale.py --check && exec python3 -m http.server 8899 --bind 0.0.0.0 --directory /tmp"
24 } else new {}
25 http = if (passive) new { containerPort = 8899 } else null
26 volumes {
27 ["/data"] {}
28 ["/media"] { src = site.mediaRoot; readOnly = site.mediaReadOnly }
29 }
30 env {
31 ["STATE_DIR"] = "/data"
32 ["INDEP_DIR"] = "/media/\(site.jellyfinFolders["Independent"])"
33 ["SR_THREADS"] = "4"
34 }
35 }
36 ["archiver"] {
37 image = "ghcr.io/jmbannon/ytdl-sub@sha256:29f27bc2b405b303d9da07f11f53ba39f7575efb94f98fe4c2c65d40a3e83bdd"
38 entrypoint = "/bin/sh"
39 args {
40 "-c"
41 if (passive)
42 "ytdl-sub --config /config-yt/config.yaml inspect --level 1 /yt-config/subscriptions.yaml >/dev/null && exec python3 -m http.server 8899 --bind 0.0.0.0 --directory /tmp"
43 else
44 "sh /config-yt/archive-loop.sh"
45 }
46 memory = if (passive) 256 else 512
47
48 http = if (passive) new {
49 containerPort = 8899
50 } else null
51
52 volumes {
53 ["/config"] {}
54 ["/config-yt"] { config = "config" }
55 ["/yt-config"] {
56 src = "\(site.cloverRoot)/Documents/Config/Youtube Downloader"
57 readOnly = true
58 }
59 ["/media"] {}
60 when (!passive) {
61 ["/media/jellyfin/Independent"] {
62 src = "\(site.mediaRoot)/\(site.jellyfinFolders["Independent"])"
63 readOnly = site.mediaReadOnly
64 }
65 }
66 }
67
68 env {
69 ["HOME"] = "/config"
70 }
71 }
72}