Check that podcast url is a string

main
bashrc 2026-04-13 10:56:02 +01:00
parent 980f49ff21
commit c90d9c8e10
1 changed files with 11 additions and 1 deletions

View File

@ -555,12 +555,22 @@ def _valid_podcast_entry(base_dir: str, key: str, entry: {}) -> bool:
if not entry.get('text'): if not entry.get('text'):
if not entry.get('url'): if not entry.get('url'):
return False 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': if entry['protocol'].tolower() != 'activitypub':
return False return False
if entry.get('uri'): 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']) post_url = remove_html(entry['uri'])
elif entry.get('url'): 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: else:
post_url = entry['text'] post_url = entry['text']
if '://' not in post_url: if '://' not in post_url: