borgend/ssdp_discover.py

changeset 148
ff975e768112
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/borgend/ssdp_discover.py	Mon Jun 02 08:38:59 2025 -0500
@@ -0,0 +1,11 @@
+from ssdpy import SSDPClient
+
+def discover_repository_provider(uuid):
+    # TODO: this should be initialised only once
+    client = SSDPClient()
+    devices = client.m_search("borg")
+    for device in devices:
+        if device["usn"] == uuid:
+            return device["location"]
+
+    return None

mercurial