From: Oleg Broytman Date: Sat, 13 Oct 2007 09:02:12 +0000 (+0000) Subject: Store only images as icons; do not store text/html errorrs. X-Git-Tag: v4.5.3~284 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=55ee943b3ef63d03826318d36fd964d182c3c322;p=bookmarks_db.git Store only images as icons; do not store text/html errorrs. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@92 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- diff --git a/Robots/bkmk_rsimple.py b/Robots/bkmk_rsimple.py index 1c4795c..63c0b4c 100644 --- a/Robots/bkmk_rsimple.py +++ b/Robots/bkmk_rsimple.py @@ -181,7 +181,10 @@ class robot_simple(Robot): icon_file.close() os.remove(fname) content_type = headers["Content-Type"] - bookmark.icon = "data:%s;base64,%s" % (content_type, b64encode(icon)) + if content_type.startswith("image/"): + bookmark.icon = "data:%s;base64,%s" % (content_type, b64encode(icon)) + else: + bookmark.icon = None except KeyError: pass