From 0d2eeca26d74cd121e54a3137e443995c4b54be1 Mon Sep 17 00:00:00 2001 From: Boris Fersing <3963983+fersingb@users.noreply.github.com> Date: Wed, 28 Jan 2026 00:49:47 +0000 Subject: [PATCH] Add a random ID thaat helps identifying multiple instances behind a public IP --- pyhilo/const.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyhilo/const.py b/pyhilo/const.py index 63fe71f..16baf0b 100755 --- a/pyhilo/const.py +++ b/pyhilo/const.py @@ -1,9 +1,13 @@ import logging import platform +import uuid from typing import Final import aiohttp +# THe instance ID is random and unique to a specific instance/run. +# Helps identifying multiple instances behind the same public IP, can be useful to the Hilo/HQ devs for debugging purposes +INSTANCE_ID: Final = str(uuid.uuid4())[24:] LOG: Final = logging.getLogger(__package__) DEFAULT_STATE_FILE: Final = "hilo_state.yaml" REQUEST_RETRY: Final = 9 @@ -46,7 +50,7 @@ # Request constants -DEFAULT_USER_AGENT: Final = f"PyHilo/{PYHILO_VERSION} aiohttp/{aiohttp.__version__} Python/{platform.python_version()}" +DEFAULT_USER_AGENT: Final = f"PyHilo/{PYHILO_VERSION}-{INSTANCE_ID} aiohttp/{aiohttp.__version__} Python/{platform.python_version()}" # NOTE(dvd): Not sure how to get new ones so I'm using the ones from my emulator