From a23d6fe1fb922e8ea8789245ab2ee00ba5f4490e Mon Sep 17 00:00:00 2001 From: nanos Date: Mon, 24 Jun 2024 17:13:23 +0100 Subject: [PATCH] Add Instance name to FediFetcher UA [fixes #122] --- find_posts.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/find_posts.py b/find_posts.py index 9043534a..6153eba9 100644 --- a/find_posts.py +++ b/find_posts.py @@ -970,7 +970,11 @@ def get(url, headers = {}, timeout = 0, max_tries = 5): """A simple wrapper to make a get request while providing our user agent, and respecting rate limits""" h = headers.copy() if 'User-Agent' not in h: - h['User-Agent'] = 'FediFetcher (https://go.thms.uk/mgr)' + h['User-Agent'] = f"FediFetcher (+{arguments.server}; https://go.thms.uk/ff)" + logger.debug(f"User Agent: {h['User-Agent']}") + + + raise Exception('error') if timeout == 0: timeout = arguments.http_timeout