update
This commit is contained in:
20
CLAUDE.md
20
CLAUDE.md
@@ -31,12 +31,12 @@ Drei Komponenten:
|
||||
|
||||
### Server (`backend/`)
|
||||
- **Python, FastAPI, SQLAlchemy, SQLite** (`videos/youtubeapp.db`)
|
||||
- **yt-dlp + ffmpeg** fuer Video-Download und Streaming
|
||||
- **yt-dlp + ffmpeg + Deno** fuer Video-Download und Streaming
|
||||
- **WebSocket** (`/ws`) — benachrichtigt verbundene Clients bei neuen Videos
|
||||
- Dockerisiert: `docker compose up --build -d` im `backend/` Verzeichnis
|
||||
- Laeuft auf `http://localhost:8000`
|
||||
- Download-Service speichert Videos unter `/videos/{id}.mp4`
|
||||
- Stream-Service: heruntergeladene Videos von Datei, sonst progressiver Download via yt-dlp mit gleichzeitigem Streaming
|
||||
- Stream-Service: heruntergeladene Videos von Datei, sonst ffmpeg Live-Muxing von Video+Audio mit gleichzeitigem Streaming und Speichern
|
||||
- Dedup: beim Batch-Import wird bestehender Eintrag mit gleicher Video-ID geloescht und neu eingefuegt
|
||||
- Sortierung: nach ID absteigend (erstes Video im Batch bekommt hoechste ID)
|
||||
- Profile: fest in DB definiert, Videos ueber Many-to-Many zugeordnet
|
||||
@@ -50,10 +50,10 @@ Drei Komponenten:
|
||||
- OkHttp WebSocket-Client — automatisches Neuladen bei neuen Videos
|
||||
- Navigation mit TopBar (Profil-Auswahl, Aufraeumen-Icon) und Bottom Bar, Dark Theme
|
||||
- Profil-Auswahl wird in SharedPreferences persistiert, filtert Videos nach Profil
|
||||
- Lokaler Download: Videos werden auf dem Geraet gespeichert, lokal bevorzugt abgespielt
|
||||
- Lokaler Download: Videos und Metadaten werden auf dem Geraet gespeichert, lokal bevorzugt abgespielt, offline verfuegbar
|
||||
- Aufraeumen: loescht alle nicht lokal gespeicherten Videos des Profils (sendet lokale IDs als Ausnahme)
|
||||
- Server-IP konfigurierbar in `ApiClient.kt` (aktuell `192.168.178.92`)
|
||||
- Emulator: Android Studio → Device Manager → Pixel 6a, API 35
|
||||
- Server-IP konfigurierbar in `ApiClient.kt` (Emulator: `10.0.2.2`, echtes Geraet: `192.168.178.34`)
|
||||
- Emulator: Android Studio → Device Manager → Pixel 7a, API 36
|
||||
|
||||
## API Endpoints
|
||||
|
||||
@@ -64,7 +64,7 @@ Drei Komponenten:
|
||||
- `DELETE /videos?profile_id=X&exclude_ids=` — Videos des Profils loeschen (ausser lokal gespeicherte)
|
||||
- `POST /videos/{id}/download` — Download auf Server triggern
|
||||
- `GET /videos/{id}/stream` — Video streamen (von Datei oder progressiver Download via yt-dlp)
|
||||
- `GET /videos/{id}/file` — Video-Datei zum Download auf Client ausliefern
|
||||
- `GET /videos/{id}/file` — Video-Datei zum Download auf Client ausliefern, setzt Download-Status zurueck wenn Datei fehlt
|
||||
- `DELETE /videos/{id}/file` — Server-Datei loeschen (nach lokalem Download)
|
||||
- `WS /ws` — WebSocket, sendet Profile-IDs bei neuen Videos
|
||||
|
||||
@@ -80,8 +80,8 @@ backend/
|
||||
services/
|
||||
video_service.py — CRUD-Operationen, Dedup, Profil-Filter
|
||||
download_service.py — yt-dlp Download
|
||||
stream_service.py — Progressiver Download + Streaming via yt-dlp
|
||||
Dockerfile — Python 3.12 + ffmpeg
|
||||
stream_service.py — ffmpeg Live-Muxing + Streaming
|
||||
Dockerfile — Python 3.12 + ffmpeg + Deno
|
||||
docker-compose.yml — Service-Definition, Port 8000, Volume /videos
|
||||
.dockerignore — videos/, __pycache__/
|
||||
.gitignore — videos/, __pycache__/
|
||||
@@ -116,6 +116,8 @@ app/
|
||||
- Server-Datei wird nach lokalem Download geloescht — spart Speicherplatz auf dem Server
|
||||
- DOM-Extraktion statt ytInitialData-Parsing — funktioniert auch bei SPA-Navigation und Scrollen
|
||||
- IntersectionObserver statt blindem Scan — nur sichtbare Videos erfassen
|
||||
- Progressiver Download via yt-dlp mit gleichzeitigem Streaming statt komplettem Download vor dem Abspielen
|
||||
- ffmpeg Live-Muxing statt komplettem Download vor dem Abspielen
|
||||
- Deno als JavaScript-Runtime fuer yt-dlp — YouTube erfordert JS-Ausfuehrung zur URL-Extraktion
|
||||
- Videos ohne Profilzuweisung werden automatisch dem Standardprofil zugeordnet
|
||||
- WebSocket statt Polling — effiziente Echtzeit-Aktualisierung der Videoliste
|
||||
- Sprache der Dokumentation: Deutsch
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
- DELETE /videos?profile_id=X&exclude_ids= — Videos des Profils loeschen (ausser lokal gespeicherte)
|
||||
- POST /videos/{id}/download — Download triggern
|
||||
- GET /videos/{id}/stream — Video streamen
|
||||
- GET /videos/{id}/file — Video-Datei zum Download ausliefern
|
||||
- GET /videos/{id}/file — Video-Datei zum Download ausliefern, setzt Download-Status zurueck wenn Datei fehlt
|
||||
- DELETE /videos/{id}/file — Server-Datei loeschen (nach lokalem Download)
|
||||
- WS /ws — WebSocket, benachrichtigt Clients bei neuen Videos
|
||||
## Services
|
||||
- VideoService — Videos speichern, abrufen, Status verwalten
|
||||
- DownloadService — yt-dlp aufrufen, Video herunterladen
|
||||
- StreamService — Live-Streaming via yt-dlp + ffmpeg
|
||||
- StreamService — ffmpeg Live-Muxing von Video+Audio, gleichzeitiges Streaming und Speichern
|
||||
## Model
|
||||
- Video — id, title, youtuber, thumbnail_url, youtube_url, file_path
|
||||
- Profile — id, name
|
||||
@@ -27,11 +27,11 @@
|
||||
- AllVideosScreen — alle Videos als Cards
|
||||
- DownloadedVideosScreen — heruntergeladene Videos als Cards
|
||||
- VideoDetailScreen — Starten, Download, Zurück, Löschen
|
||||
- VideoPlayerScreen — Player mit Standard-Controls
|
||||
- VideoPlayerScreen — Player mit Standard-Controls, Rotation behaelt Video-Position bei
|
||||
## ViewModel
|
||||
- VideoViewModel — Video-State verwalten, API-Aufrufe triggern, lokal bevorzugen sonst streamen
|
||||
## Services
|
||||
- LocalStorageService — Videos lokal speichern, pruefen, loeschen
|
||||
- LocalStorageService — Videos und Metadaten lokal speichern, pruefen, loeschen (offline verfuegbar)
|
||||
## API
|
||||
- ServerApi — kommuniziert mit FastAPI (GET /profiles, GET /videos, POST /download, GET /stream, GET /videos/{id}/file, DELETE /videos/{id}/file, DELETE /videos)
|
||||
## Model
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- Javascript: Daten angezeigter Videos an Server senden
|
||||
# Server
|
||||
- FastAPI: Videodaten empfangen
|
||||
- yt-dlp + ffmpeg: Video herunterladen, Videos streamen
|
||||
- yt-dlp + ffmpeg + Deno: Video herunterladen, Videos streamen
|
||||
- SQLite: Daten persistieren
|
||||
# App
|
||||
- Kotlin: Videos auflisten, Download triggern, Videos abspielen
|
||||
|
||||
Reference in New Issue
Block a user