From 4d62a93e7be8b6f656e8e1d9a7e2c13ac85ce8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Pe=C5=A1ek=20=28Kof=29?= Date: Thu, 5 Nov 2026 23:06:10 +0100 Subject: [PATCH] feat(gxbox): add cast-gxbox and stream-gxbox with pre-flight renderer probe --- cast-gxbox | 1 + cast-tesla | 15 +++++++++++++++ stream-gxbox | 1 + 3 files changed, 17 insertions(+) create mode 120000 cast-gxbox create mode 120000 stream-gxbox diff --git a/cast-gxbox b/cast-gxbox new file mode 120000 index 0000000..6f4ea2e --- /dev/null +++ b/cast-gxbox @@ -0,0 +1 @@ +cast-tesla \ No newline at end of file diff --git a/cast-tesla b/cast-tesla index 3216bda..68ca3e5 100755 --- a/cast-tesla +++ b/cast-tesla @@ -27,7 +27,22 @@ def get_local_ip(target_ip): LOCAL_IP = get_local_ip(RENDERER_IP) CONTROL_URL = f"http://{RENDERER_IP}:{RENDERER_PORT}/_urn:schemas-upnp-org:service:AVTransport_control" +def is_renderer_online(ip, port): + try: + import socket + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.settimeout(1.5) + res = s.connect_ex((ip, port)) + s.close() + return res == 0 + except Exception: + return False + def send_soap(action, body_xml): + if not is_renderer_online(RENDERER_IP, RENDERER_PORT): + print(f"[cast-gxbox] Upozornění: Port {RENDERER_PORT} na {RENDERER_IP} zatím neodpovídá.") + print(f"[cast-gxbox] Zapněte na set-top boxu DLNA DMR: Menu -> Aplikace / Síť -> DLNA DMR.") + return None soap = f""" diff --git a/stream-gxbox b/stream-gxbox new file mode 120000 index 0000000..6f4ea2e --- /dev/null +++ b/stream-gxbox @@ -0,0 +1 @@ +cast-tesla \ No newline at end of file