diff --git a/Kapitel 13/Tutorial.md b/Kapitel 13/Tutorial.md index 120da9e..375fa3d 100644 --- a/Kapitel 13/Tutorial.md +++ b/Kapitel 13/Tutorial.md @@ -425,4 +425,38 @@ Im Ergebnis findest du im Feld `data[0].id` deine **User-ID** (z. B. `123456789` - Rename Output: ON - Output Name: NEED_CHECK ``` - Damit hat der Switch-Node drei klar benannte Ausgänge, die die weitere Logik steuern. \ No newline at end of file + Damit hat der Switch-Node drei klar benannte Ausgänge, die die weitere Logik steuern. + +8. Pfad CREATE_AND_DOWNLOAD + + Verkabelung: + Switch-Node (Output: CREATE_AND_DOWNLOAD) + → SSH: State-Datei anlegen + → SSH: VOD herunterladen (yt-dlp) + + + Node 1: SSH – State-Datei anlegen + Typ: SSH + Credentials: SSH Clipper + Operation: Execute Command + Command is an Expression: ON + Command (Expression): + ```git + {{`set -euo pipefail; mkdir -p /srv/clipper/state; printf "%s + " "${$json.data[0].id}" > /srv/clipper/state/vod_seen.list`}} + ``` + + Node 2: SSH – VOD herunterladen (yt-dlp) + Typ: SSH + Credentials: SSH Clipper + Operation: Execute Command + Command is an Expression: ON + Command (Expression): + ```git + {{`set -euo pipefail; mkdir -p /srv/clipper/watch; URL="https://www.twitch.tv/videos/${$json.data[0].id}"; yt-dlp --no-progress --remux-video mp4 -o "/srv/clipper/watch/%(id)s.%(ext)s" "$URL"`}} + ``` + + Ergebnis: + - /srv/clipper/state/vod_seen.list existiert und enthält die aktuelle VOD-ID (eine Zeile). + - Das VOD liegt als MP4 unter /srv/clipper/watch/.mp4 bereit. + \ No newline at end of file