Files
ViewIT/tests/test_dokustreams_live.py
itdrui.de 7b60b00c8b dev: umfangreiches Refactoring, Trakt-Integration und Code-Review-Fixes (0.1.69-dev)
Core & Architektur:
- Neues Verzeichnis addon/core/ mit router.py, trakt.py, metadata.py,
  gui.py, playstate.py, plugin_manager.py, updater.py
- Tests-Verzeichnis hinzugefügt (24 Tests, pytest + Coverage)

Trakt-Integration:
- OAuth Device Flow, Scrobbling, Watchlist, History, Calendar
- Upcoming Episodes, Weiterschauen (Continue Watching)
- Watched-Status in Episodenlisten
- _trakt_find_in_plugins() mit 5-Min-Cache

Serienstream-Suche:
- API-Ergebnisse werden immer mit Katalog-Cache ergänzt (serverseitiges 10-Treffer-Limit)
- Katalog-Cache wird beim Addon-Start im Daemon-Thread vorgewärmt
- Notification nach Cache-Load via xbmc.executebuiltin() (thread-sicher)

Bugfixes (Code-Review):
- Race Condition auf _TRAKT_WATCHED_CACHE: _TRAKT_WATCHED_CACHE_LOCK hinzugefügt
- GUI-Dialog aus Daemon-Thread: xbmcgui -> xbmc.executebuiltin()
- ValueError in Trakt-Watchlist-Routen abgesichert
- Token expires_at==0 Check korrigiert
- get_setting_bool() Kontrollfluss in gui.py bereinigt
- topstreamfilm_plugin: try-finally um xbmcvfs.File.close()

Cleanup:
- default.py.bak und refactor_router.py entfernt
- .gitignore: /tests/ Eintrag entfernt
- Type-Hints vereinheitlicht (Dict/List/Tuple -> dict/list/tuple)
2026-03-01 18:39:05 +01:00

31 lines
850 B
Python

import re
import shutil
import subprocess
import pytest
@pytest.mark.live
def test_dokustreams_embed_url_via_curl():
if shutil.which('curl') is None:
pytest.skip('curl not available')
url = 'https://doku-streams.com/verbrechen/deutsche-im-knast-japan-und-die-disziplin/'
result = subprocess.run(
['curl', '-L', '-s', '--compressed', url],
check=False,
capture_output=True,
text=False,
)
assert result.returncode == 0
html = result.stdout.decode('utf-8', errors='ignore')
assert html
iframe_match = re.search(r'<iframe[^>]+src="([^"]+)"', html, re.IGNORECASE)
if iframe_match is None:
iframe_match = re.search(r'"embedUrl"\s*:\s*"([^"]+)"', html)
assert iframe_match is not None
src = iframe_match.group(1)
assert 'youtube' in src or 'vimeo' in src