X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Robots%2Fbkmk_robot_base.py;h=52d6b563f1056c9ffe29a08299d59084d248be4e;hb=066f29ea81222a8a2ddd4ab1aff131d7fc1ec37f;hp=d8877c6f41c6b6f30c8d8ba4b8dbcec396e6c02b;hpb=3dcc828780e34c685703def5278607cfd283fb72;p=bookmarks_db.git diff --git a/Robots/bkmk_robot_base.py b/Robots/bkmk_robot_base.py index d8877c6..52d6b56 100644 --- a/Robots/bkmk_robot_base.py +++ b/Robots/bkmk_robot_base.py @@ -149,8 +149,9 @@ class robot_base(Robot): if content_type.startswith(ctype): is_html = True break - if content and is_html: - parser = parse_html(content, charset, self.log) + content_stripped = content.strip() + if content_stripped and is_html: + parser = parse_html(content_stripped, charset, self.log) if parser: bookmark.real_title = parser.title icon = parser.icon @@ -246,7 +247,7 @@ class robot_base(Robot): % (url, timeout) ) - if not content: + if not content_stripped: self.log(" empty response, no content") if not is_html: self.log(" not html")