Enhance Dockerfile and API for yt-dlp integration

- Install Deno as a JavaScript runtime for yt-dlp in the Dockerfile.
- Add configuration for yt-dlp to support cookies and JavaScript runtime selection.
- Update API to handle cookies for YouTube bot detection and allow specifying the JavaScript runtime.
- Introduce new environment variables for cookie management and JavaScript runtime configuration in README.
This commit is contained in:
Peter Meier
2025-12-22 12:58:09 +01:00
parent eb32dd1064
commit a8f822807d
3 changed files with 69 additions and 8 deletions

View File

@@ -101,6 +101,9 @@ Siehe [BUILD-MACOS.md](./BUILD-MACOS.md) für detaillierte Anleitung.
- `SESSION_SECRET`: Secret für Session-Cookies (Standard: `default-secret-change-in-production`)
- `STREAM_ONLY`: Wenn auf `true` gesetzt, werden Dateien nicht physisch gespeichert, sondern direkt als Download-Stream angeboten (Standard: `false`)
- `LOCALE`: Sprache der Anwendung - `de` für Deutsch oder `en` für Englisch (Standard: `de`)
- `YT_DLP_COOKIES`: Pfad zu einer Cookie-Datei für yt-dlp (z.B. `./cookies.txt`). Wird verwendet, um YouTube Bot-Erkennung zu umgehen. Siehe [yt-dlp Cookie-Dokumentation](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp)
- `YT_DLP_COOKIES_FROM_BROWSER`: Browser-Name, aus dem Cookies geladen werden sollen (z.B. `chrome`, `firefox`, `edge`, `safari`). Alternative zu `YT_DLP_COOKIES`. Siehe [yt-dlp Cookie-Dokumentation](https://github.com/yt-dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies)
- `YT_DLP_JS_RUNTIME`: JavaScript Runtime für yt-dlp (Standard: `deno`). Andere Optionen: `node`, `d8`, etc.
**Beispiel `.env` Datei mit Login:**
```
@@ -111,6 +114,7 @@ DOWNLOAD_DIR=./downloaded
SESSION_SECRET=mein-geheimes-session-secret
STREAM_ONLY=false
LOCALE=de
YT_DLP_COOKIES_FROM_BROWSER=chrome
```
**Beispiel `.env` Datei ohne Login:**
@@ -119,8 +123,15 @@ LOGIN=false
DOWNLOAD_DIR=./downloaded
STREAM_ONLY=false
LOCALE=de
YT_DLP_COOKIES_FROM_BROWSER=chrome
```
**Hinweis zu Cookies:**
- Wenn YouTube Bot-Erkennung auftritt, müssen Cookies verwendet werden
- `YT_DLP_COOKIES_FROM_BROWSER` ist die einfachste Option: Gibt den Browser-Namen an (z.B. `chrome`, `firefox`, `edge`, `safari`)
- Alternativ kann `YT_DLP_COOKIES` mit dem Pfad zu einer Cookie-Datei verwendet werden
- Cookie-Dateien können mit Browser-Erweiterungen wie "Get cookies.txt LOCALLY" oder "cookies.txt" exportiert werden
**Hinweis zu `LOGIN`:**
- Wenn `LOGIN=false`: Keine Login-Seite, alle Seiten sind öffentlich zugänglich. `LOGIN_USERNAME` und `LOGIN_PASSWORD` werden ignoriert.
- Wenn `LOGIN=true` oder nicht gesetzt: Login ist aktiviert. `LOGIN_USERNAME` und `LOGIN_PASSWORD` müssen gesetzt sein.