mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-05 23:45:07 +00:00
feat(remote)!: make remote serve WebSocket-only and refuse older clients with CLIENT_OUTDATED
This commit is contained in:
@@ -15,6 +15,8 @@ from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.remote.e2e.channel import open_session
|
||||
|
||||
pytestmark = [pytest.mark.live, pytest.mark.slow]
|
||||
|
||||
|
||||
@@ -27,7 +29,7 @@ def create_session(http_session, server_url: str, service: str, title_id: str) -
|
||||
"vcodec": ["AVC", "HEVC"],
|
||||
"best_available": True,
|
||||
}
|
||||
r = http_session.post(f"{server_url}/api/session/create", json=payload, timeout=120)
|
||||
r = open_session(http_session, server_url, payload)
|
||||
if r.status_code >= 400:
|
||||
pytest.skip(f"{service}: session create failed {r.status_code}: {r.text[:200]}")
|
||||
return r.json()["session_id"]
|
||||
@@ -44,7 +46,7 @@ def wait_for_titles(http_session, server_url: str, sid: str, timeout: float = 12
|
||||
body = r.json()
|
||||
except Exception:
|
||||
body = {}
|
||||
if (body.get("details") or {}).get("auth_status") in ("authenticating", "pending_input"):
|
||||
if (body.get("details") or {}).get("auth_status") == "authenticating":
|
||||
time.sleep(2.0)
|
||||
continue
|
||||
return r.status_code, r.json() if r.text else {}
|
||||
|
||||
Reference in New Issue
Block a user