From c90d9c8e10250cf83cb7c049fa72caf0fe2f670e Mon Sep 17 00:00:00 2001 From: bashrc Date: Mon, 13 Apr 2026 10:56:02 +0100 Subject: [PATCH] Check that podcast url is a string --- newswire.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/newswire.py b/newswire.py index 1075ecff4..5343490f7 100644 --- a/newswire.py +++ b/newswire.py @@ -555,12 +555,22 @@ def _valid_podcast_entry(base_dir: str, key: str, entry: {}) -> bool: if not entry.get('text'): if not entry.get('url'): return False + if not isinstance(entry['protocol'], str): + print('WARN: podcast protocol is not a string ' + + str(entry)) + return False if entry['protocol'].tolower() != 'activitypub': return False if entry.get('uri'): + if not isinstance(entry['uri'], str): + print('podcast uri is not a string ' + str(entry)) + return False post_url = remove_html(entry['uri']) elif entry.get('url'): - post_url = remove_html(entry['uri']) + if not isinstance(entry['url'], str): + print('podcast url is not a string ' + str(entry)) + return False + post_url = remove_html(entry['url']) else: post_url = entry['text'] if '://' not in post_url: