From 5472eae926b2193739cc4fbc20c03f1c77869201 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 10 Sep 2024 18:33:31 +0300 Subject: [PATCH] Feat: Limit `max_urls` in scripts that check only 1 or few URLs --- bkmk-add.py | 1 + check_urls.py | 1 + get_url.py | 1 + 3 files changed, 3 insertions(+) diff --git a/bkmk-add.py b/bkmk-add.py index 8259df5..05e3bbb 100755 --- a/bkmk-add.py +++ b/bkmk-add.py @@ -58,6 +58,7 @@ def run(): print("Using", robot) robot = robot(None) + robot.max_urls = 1 robot.check_bookmark(bookmark) # get real title and last modified date robot.stop() diff --git a/check_urls.py b/check_urls.py index 6e0ada8..553ba73 100755 --- a/check_urls.py +++ b/check_urls.py @@ -43,6 +43,7 @@ def run(): from robots import robot print("Using", robot) robot = robot(log) + robot.max_urls = min(robot.max_urls, len(sys.argv[1:])) bookmarks = [] for url in sys.argv[1:]: diff --git a/get_url.py b/get_url.py index c9b23e2..3fb5d46 100755 --- a/get_url.py +++ b/get_url.py @@ -27,6 +27,7 @@ def run(): from robots import robot print("Using", robot) robot = robot(sys.stdout.write) + robot.max_urls = 1 url = args.URL error, redirect_code, redirect_to, headers, content = \ -- 2.39.5