From 64dd05837d6e063eac834527ae36e9c367ab31e0 Mon Sep 17 00:00:00 2001 From: Schimon Jehudah Date: Wed, 20 Jul 2022 07:14:00 +0000 Subject: [PATCH] Update slixfeed.py --- slixfeed.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/slixfeed.py b/slixfeed.py index a4371ba..06476d9 100644 --- a/slixfeed.py +++ b/slixfeed.py @@ -374,17 +374,18 @@ async def download_updates(conn): source = url[0] html = await download_page(url[0]) print(url[0]) - try: - feed = feedparser.parse(html) - if feed.bozo: - bozo = ("WARNING: Bozo detected for feed <{}>. " - "For more information, visit " - "https://pythonhosted.org/feedparser/bozo.html" - .format(source)) - print(bozo) - except (IncompleteReadError, IncompleteRead, error.URLError) as e: - print(e) - continue + if html: + try: + feed = feedparser.parse(html) + if feed.bozo: + bozo = ("WARNING: Bozo detected for feed <{}>. " + "For more information, visit " + "https://pythonhosted.org/feedparser/bozo.html" + .format(source)) + print(bozo) + except (IncompleteReadError, IncompleteRead, error.URLError) as e: + print(e) + return # TODO Place these couple of lines back down # NOTE Need to correct the SQL statement to do so entries = feed.entries