]> git.phdru.name Git - bookmarks_db.git/commitdiff
Feat(check_urls): Separately report redirects
authorOleg Broytman <phd@phdru.name>
Wed, 7 Aug 2024 21:51:21 +0000 (00:51 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 7 Aug 2024 21:51:21 +0000 (00:51 +0300)
check_urls.py

index 103553ae36068385ee721f9739cb88c5c112d6a1..2111b3fa4b06b11ea4be30be63ed4ace9a1953dc 100755 (executable)
@@ -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,