]> git.phdru.name Git - bookmarks_db.git/commitdiff
Feat: Limit `max_urls` in scripts that check only 1 or few URLs
authorOleg Broytman <phd@phdru.name>
Tue, 10 Sep 2024 15:33:31 +0000 (18:33 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 10 Sep 2024 15:59:35 +0000 (18:59 +0300)
bkmk-add.py
check_urls.py
get_url.py

index 8259df5934b1057a753af6a9fb2abf32970646e5..05e3bbbe902a814b7f9059882f3dbeaeae9363dc 100755 (executable)
@@ -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()
index 6e0ada87a1d90efa4a26ec1796bda2d4f4db95b2..553ba73516446151a41caf5549f04fb1a036809f 100755 (executable)
@@ -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:]:
index c9b23e26db3df4524c1b28c4ae53e3abcaba27a9..3fb5d46d0d9b745563d49e54c6b08def0dfc39c4 100755 (executable)
@@ -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 = \