summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortechchud <protrude_paying969@simplelogin.com>2025-08-17 19:55:26 -0500
committertechchud <protrude_paying969@simplelogin.com>2025-08-17 19:55:26 -0500
commitdd31bc623b852b7cea84df61b48b4fed9a42a791 (patch)
treeaa04bfdc953f8b64a6bda878babaa2b74746a8cb
parentbd82f59cb2ab25a8ff83f41b0d361af5d3a5f2de (diff)
downloaddilbertRss-master.tar.gz
dilbertRss-master.tar.bz2
dilbertRss-master.zip
if there's no comic, then break the loopHEADmaster
-rw-r--r--README.md3
-rwxr-xr-xmain.py9
2 files changed, 9 insertions, 3 deletions
diff --git a/README.md b/README.md
index 905e353..2a8961d 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@
run `uvicorn main:app --port 8866` in this directory to start the RSS feed reader.
# Dependencies
+This assumes you're using Debian bullseye.
+```
python3
BeautifulSoup
tor
@@ -9,3 +11,4 @@ python3-feedgenerator
python3-fastapi
python3-requests
python3-socks
+```
diff --git a/main.py b/main.py
index 2293634..3aa5fb5 100755
--- a/main.py
+++ b/main.py
@@ -32,9 +32,12 @@ async def root():
search = session.get("https://dilbert.com/strip/" + date)
soup = bs4.BeautifulSoup(search.text, features="lxml")
- comicTitle = soup.find("meta", property="og:title")["content"]
- comicURL = soup.find("meta", property="og:image")["content"]
- comicAuthor = soup.find("meta", property="article:author")["content"]
+ try:
+ comicTitle = soup.find("meta", property="og:title")["content"]
+ comicURL = soup.find("meta", property="og:image")["content"]
+ comicAuthor = soup.find("meta", property="article:author")["content"]
+ except:
+ continue
url = "https://dilbert.com/strip/" + date
sneed.add_item( title=comicTitle, description=comicURL, author_name=comicAuthor, link=url, id=id)