Convert HTML in content/summary to Markdown

This commit is contained in:
2023-01-14 12:54:03 +01:00
parent 0700a169fa
commit 873f5b3f7a
7 changed files with 101 additions and 75 deletions

View File

@ -10,7 +10,7 @@ data_dir: str = user_data_dir(appname="discord_rss_bot", appauthor="TheLovinator
os.makedirs(data_dir, exist_ok=True)
def get_webhook_for_entry(custom_reader: Reader, entry: Entry) -> str | None:
def get_webhook_for_entry(custom_reader: Reader, entry: Entry) -> str:
"""
Get the webhook from the database.
@ -26,12 +26,12 @@ def get_webhook_for_entry(custom_reader: Reader, entry: Entry) -> str | None:
# Get the webhook from the feed.
# Is None if not found or error.
webhook_url: str | None
webhook_url: str
try:
webhook_url = str(reader.get_tag(entry.feed_url, "webhook"))
except TagNotFoundError:
print(f"Webhook not found for feed {entry.feed_url}")
webhook_url = None
webhook_url = ""
return webhook_url