From: Oleg Broytman Date: Tue, 10 Sep 2024 15:33:31 +0000 (+0300) Subject: Feat: Limit `max_urls` in scripts that check only 1 or few URLs X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=5472eae926b2193739cc4fbc20c03f1c77869201;p=bookmarks_db.git Feat: Limit `max_urls` in scripts that check only 1 or few URLs --- 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 = \