Fix ytdlp

This commit is contained in:
2025-08-21 09:48:04 +02:00
parent 8a79de8cf3
commit 1a11aa205d
5 changed files with 39 additions and 9 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -7,7 +7,7 @@ labels:
app.kubernetes.io/component: ytdlp
configMapGenerator:
- name: scripts
- name: sync-scripts
files:
- ./ytdlp-sync.sh

View File

@@ -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

View File

@@ -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