From ebdbe96b2f8436e09e4c55a77ca6143224d08119 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 8 Aug 2024 00:51:21 +0300 Subject: [PATCH] Feat(check_urls): Separately report redirects --- check_urls.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/check_urls.py b/check_urls.py index 103553a..2111b3f 100755 --- a/check_urls.py +++ b/check_urls.py @@ -56,15 +56,18 @@ def run(): log.close() for bookmark in bookmarks: + moved_to = getattr(bookmark, 'moved', None) if hasattr(bookmark, 'error'): print(bookmark.error) + elif moved_to: + print("Moved to: %s" % moved_to) + else: print("""\ Title: %s URL: %s LastModified: %s - Moved: %s Size: %s Md5: %s IconURI: %s @@ -75,7 +78,6 @@ def run(): or getattr(bookmark, 'title', None), bookmark.href, strftime(bookmark.last_modified), - getattr(bookmark, 'moved', None), getattr(bookmark, 'size', None), getattr(bookmark, 'md5', None), bookmark.icon_href, bookmark.icon, bookmark.charset, -- 2.39.5