Too many requests was causing Arch Linux news to break

This commit is contained in:
flyingscorpio@arch-desktop 2021-03-06 13:44:41 +01:00
parent a4568d42e2
commit 83ff957410
2 changed files with 5 additions and 1 deletions

View file

@ -41,7 +41,7 @@ UPDATE_COLOR=#ffff85
LABEL=
[arch_linux_news]
interval=30
interval=60
[temperature]
label=<span foreground='#c7505c'>  </span>

View file

@ -25,6 +25,10 @@ def main() -> None:
url = "https://www.archlinux.org/feeds/news/"
feed = feedparser.parse(url)
summary = feed["feed"].get("summary")
if summary is not None and "too many requests" in summary.lower():
print("Arch Linux news: too many requests")
return
latest_title = feed["entries"][0]["title"]
latest_link = feed["entries"][0]["link"]