From 8ef439ba286a3ddb28d0f06ca438150247885f23 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 16 Aug 2024 16:37:42 +0300 Subject: [PATCH] Feat(bkmk_robot_base): Send our version in `X-User-Agent` header --- Robots/bkmk_robot_base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Robots/bkmk_robot_base.py b/Robots/bkmk_robot_base.py index ddece90..4ccd093 100644 --- a/Robots/bkmk_robot_base.py +++ b/Robots/bkmk_robot_base.py @@ -20,7 +20,7 @@ import time from m_lib.md5wrapper import md5wrapper from m_lib.net.www.util import parse_time -from bkmk_objects import Robot +from bkmk_objects import __version__, Robot from parse_html import parse_html @@ -34,7 +34,8 @@ request_headers = { 'Referer': '/', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:120.0) ' 'Gecko/20100101 Firefox/120.0', - 'X-User-Agent': 'bookmarks_db (Python %d.%d.%d)' % sys.version_info[:3], + 'X-User-Agent': 'bookmarks_db %s (Python %d.%d.%d)' % ( + __version__, *sys.version_info[:3]), } -- 2.39.5