Files
xstreamDownloader/STATUS.md
T

102 lines
4.2 KiB
Markdown
Raw Normal View History

2026-07-07 13:56:09 +02:00
# xStream Downloader Projektstatus
Stand: 6.7.2026, 22:25
## Ziel
Web-Wrapper für das xstream Kodi-Addon, mit dem man Filme suchen, finden
und herunterladen kann direkt im Browser, ohne Kodi.
## Architektur-Entscheidung
- **Option A**: Web-Wrapper mit XBMC-konformen Mock-Modulen
- Vorteil: läuft ohne Kodi-Installation, Downloads landen direkt als Datei
- Die XBMC-Architektur wurde aus `/home/matthiasberner/Dokumente/git/xbmc` analysiert
## Dateistruktur
```
xstreamDownloader/
├── app.py ← AKTIVER Wrapper-App (XBMC-konform, ~800 Zeilen)
├── web/index.html ← Frontend (Sidebar, Search, Grid, Downloads)
├── xstream/sites/ ← 18 Site-Plugins
├── xstream/resources/lib/ ← xstream Core
├── deps/
│ ├── resolveurl/
│ ├── requests/
│ ├── six/
│ ├── kodi_six/
│ └── pyaes/
├── cookies/
└── downloads/
```
## Was funktioniert
1. **Flask-Server startet** auf http://localhost:8765
2. **18 Sites** werden erkannt und geladen
3. **XBMC-Mock-Module** für xbmc, xbmcgui, xbmcplugin, xbmcvfs, xbmcaddon
4. **Subprozess-Worker** mit eigenem sys.argv[1] = '1' (handle)
5. **xbmcplugin-Collector** thread-lokal (addDirectoryItem/endOfDirectory)
6. **xbmc.addon Version 20.3** verhindert float('3.8.')-Crash in resolveurl
7. **Deutsche xStream-Language-Map** Menu-Titel in Deutsch statt `[30813]`
8. **Plugin-URL-Generierung** sys.argv[0] als reiner Pfad (keine doppelten `?`)
9. **URL-Parsing** api_subentries parst plugin:// URLs und ruft die richtige Funktion auf
10. **API-Routen** alle vorhanden:
- /api/sites
- /api/sites/ID/entries
- /api/sites/ID/entries/PLUGIN_URL (parst function/site/params aus URL)
- /api/sites/ID/search?q=...
- /api/sites/ID/hosters?url=...
- /api/resolve?url=...
- /api/download?url=...&title=...
- /api/downloads[/ID][/file]
11. **Download-Manager** mit Fortschritt 0-100%
## Navigation (Menü → Inhalte)
Die Site-Plugins zeigen Menüpunkte (Neues, Filme, Serien, etc.) auf Deutsch.
Beim Klick auf einen Menüpunkt:
1. URL wird geparst: `plugin://...?site=aniworld&function=showEntries&sUrl=...`
2. Richtige Funktion (`showEntries`, `showNeues`, `showValue`, etc.) wird aufgerufen
3. Echte Filme/Serien werden geladen (getestet: AniWorld 45 Titel, HD Filme 22 Titel)
## Gelöste Bugs
| # | Bug | Fix | Datum |
|---|-----|-----|-------|
| 1 | SyntaxError `def setProperty` | sed-Korrektur | - |
| 2 | KeyError 'resources.lib.config' | Stubs nur im Worker | - |
| 3 | IndentationError in _CollectingGui.addFolder | Komplett neuer Collector | - |
| 4 | float('3.8.') Crash | xbmc.addon Version '20.3' | - |
| 5 | pyaes NOT in sys.path | deps/pyaes und deps/pyaes/lib | - |
| 6 | AttributeError 'xbmc' has no 'LOGERROR' | LOGERROR + LOGSEVERE in _make_xbmc() | 6.7.2026 |
| 7 | ModuleNotFoundError 'resources.lib' in Subprozess | BASE zum sys.path im Worker | 6.7.2026 |
| 8 | Menu-Titel als `[30813]` statt Deutsch | Deutsche Language-Map in getLocalizedString | 6.7.2026 |
| 9 | Doppelte `?` in plugin:// URLs | sys.argv[0] = reiner Plugin-Pfad | 6.7.2026 |
| 10 | Navigation: immer `showEntries` statt spezifischer Funktion | _parse_plugin_url() in api_subentries | 6.7.2026 |
| 11 | Such-API-Mismatch | Frontend: `/search?q=` statt `/entries?search=` | 6.7.2026 |
| 12 | Hoster-API-Mismatch | `?url=` statt `?entryUrl=` | 6.7.2026 |
| 13 | Download-Flow falsch | Resolve → Download → Poll statt `/resolve?download=true` | 6.7.2026 |
## Verbleibende Aufgaben
- [ ] Browser-MCP Debugging (im Browser testen)
- [ ] Hoster-Flow E2E testen (Eintrag → Hosters → Download)
- [ ] Download E2E testen (Resolve → Download → File)
- [ ] Such-Qualität verbessern (manche Sites liefern Haupteinträge statt Suchergebnisse)
- [ ] fix_and_run.sh auf app.py umstellen (bereits erledigt)
- [ ] mini_app.py wurde am 6.7.2026 gelöscht
## Starten
```bash
cd /home/matthiasberner/Schreibtisch/kodi/xstreamDownloader
python3 app.py
# → http://localhost:8765
```
## Bekannte Probleme
- Port 8765 kann von Zombie-Prozessen belegt sein → mit `pkill -9 -f "python3 app.py"` beheben
- Manche Site-Suchfunktionen geben Haupteinträge statt Suchergebnisse zurück
- Manche Sites (z.B. serienstream A-Z) können 500er Timeout-Fehler werfen