Check that url exists

main
Bob Mottram 2023-10-31 19:20:50 +00:00
parent 7fe094c540
commit 377754c95b
1 changed files with 21 additions and 18 deletions

View File

@ -4686,6 +4686,7 @@ def get_media_url_from_video(post_json_object: {}) -> (str, str, str, str):
media_url = None
media_torrent = None
media_magnet = None
if post_json_object.get('url'):
if isinstance(post_json_object['url'], list):
for media_link in post_json_object['url']:
if not isinstance(media_link, dict):
@ -4704,4 +4705,6 @@ def get_media_url_from_video(post_json_object: {}) -> (str, str, str, str):
if not media_url:
media_type = media_link['mediaType']
media_url = remove_html(media_link['href'])
else:
print('WARN: video url does not exist ' + str(post_json_object))
return media_type, media_url, media_torrent, media_magnet