X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Robots%2Fbkmk_rsimple.py;h=1842b4d7ff94e73327f127afa2b71a74c61f7ed8;hb=caa777b87bd46efba408d5fcf28b690bd28fe30b;hp=1c4795c11d6aecb8bfc6a460a260be5b56a65d8b;hpb=7028dcb5fe31ccf6d348dca315154d719f3c481e;p=bookmarks_db.git diff --git a/Robots/bkmk_rsimple.py b/Robots/bkmk_rsimple.py index 1c4795c..1842b4d 100644 --- a/Robots/bkmk_rsimple.py +++ b/Robots/bkmk_rsimple.py @@ -90,6 +90,8 @@ class robot_simple(Robot): try: try: self.start = int(time.time()) + bookmark.icon = None + url_type, url_rest = urllib.splittype(bookmark.href) url_host, url_path = urllib.splithost(url_rest) url_path, url_tag = urllib.splittag(url_path) @@ -181,7 +183,8 @@ 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)) except KeyError: pass