Record the remote server reply header

This commit is contained in:
dgtlmoon
2024-01-31 12:36:25 +01:00
parent cdb0a22979
commit 1f9bbef021

View File

@@ -491,6 +491,17 @@ class update_worker(threading.Thread):
if self.datastore.data['watching'].get(uuid):
# Always record that we atleast tried
count = self.datastore.data['watching'][uuid].get('check_count', 0) + 1
# Record the 'server' header reply, can be used for actions in the future like cloudflare/akamai workarounds
try:
self.datastore.update_watch(uuid=uuid,
update_obj={
'remote_server_reply': update_handler.fetcher.headers.get('server', '').lower()
}
)
except Exception as e:
pass
self.datastore.update_watch(uuid=uuid, update_obj={'fetch_time': round(time.time() - now, 3),
'last_checked': round(time.time()),
'check_count': count