diff --git a/apps/openebs/volumes.yaml b/apps/openebs/volumes.yaml index fd914de..4a13faf 100644 --- a/apps/openebs/volumes.yaml +++ b/apps/openebs/volumes.yaml @@ -39,3 +39,17 @@ spec: shared: "yes" status: state: Ready +--- +apiVersion: zfs.openebs.io/v1 +kind: ZFSVolume +metadata: + name: musics +spec: + capacity: 16Ti + fsType: zfs + ownerNodeID: kadan + poolName: ocean + volumeType: DATASET + shared: "yes" +status: + state: Ready diff --git a/charts/meelo/ytdlp/deploy.yaml b/charts/meelo/ytdlp/deploy.yaml index c890df8..390834c 100644 --- a/charts/meelo/ytdlp/deploy.yaml +++ b/charts/meelo/ytdlp/deploy.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: smartrss + name: yt-dlp spec: template: spec: @@ -12,27 +12,38 @@ spec: runAsNonRoot: true fsGroupChangePolicy: OnRootMismatch containers: - - name: smartrss + - name: ytdlp image: nixery.dev/shell/yt-dlp + workingDir: /work command: [/app/ytdlp-sync.sh] env: + - name: OUT + value: /musics - name: URL valueFrom: secretKeyRef: - name: yt-playlist + name: ytdlp key: url volumeMounts: - name: scripts mountPath: /app readOnly: true + - name: cookies + mountPath: /app/secrets + - name: work + mountPath: /work - name: musics mountPath: /musics volumes: - name: scripts configMap: - name: scripts + name: sync-scripts defaultMode: 0555 - name: musics persistentVolumeClaim: claimName: musics - + - name: work + emptyDir: {} + - name: cookies + secret: + secretName: ytdlp diff --git a/charts/meelo/ytdlp/kustomization.yaml b/charts/meelo/ytdlp/kustomization.yaml index d513447..0f45baa 100644 --- a/charts/meelo/ytdlp/kustomization.yaml +++ b/charts/meelo/ytdlp/kustomization.yaml @@ -7,7 +7,7 @@ labels: app.kubernetes.io/component: ytdlp configMapGenerator: - - name: scripts + - name: sync-scripts files: - ./ytdlp-sync.sh diff --git a/charts/meelo/ytdlp/secret.yaml b/charts/meelo/ytdlp/secret.yaml index 62e9aa9..f242ae2 100644 --- a/charts/meelo/ytdlp/secret.yaml +++ b/charts/meelo/ytdlp/secret.yaml @@ -1,7 +1,7 @@ apiVersion: external-secrets.io/v1 kind: ExternalSecret metadata: - name: yt-playlist + name: ytdlp spec: refreshInterval: 24h secretStoreRef: @@ -11,3 +11,6 @@ spec: - secretKey: url remoteRef: key: yt-playlist + - secretKey: cookies + remoteRef: + key: yt-cookies diff --git a/charts/meelo/ytdlp/ytdlp-sync.sh b/charts/meelo/ytdlp/ytdlp-sync.sh index 7dbb79c..f6fcf5b 100644 --- a/charts/meelo/ytdlp/ytdlp-sync.sh +++ b/charts/meelo/ytdlp/ytdlp-sync.sh @@ -1,9 +1,11 @@ -#!/usr/bien/env bash +#!/usr/bin/env bash while true; do yt-dlp "$URL" -o "$OUT/%(artist)s - %(title)s.%(ext)s" \ --extract-audio \ --embed-thumbnail --embed-metadata --embed-chapters \ - --download-archive "$OUT/ytdlp-archive.txt" + --download-archive "$OUT/ytdlp-archive.txt" \ + --cookies /app/secrets/cookies.txt \ + --cache-dir "$(pwd)" sleep 6h done