Extra search for youtube urls

main
Bob Mottram 2024-08-15 22:14:24 +01:00
parent 267d4054a1
commit f5f5c17e54
1 changed files with 15 additions and 0 deletions

View File

@ -42,6 +42,21 @@ def get_youtube(actor_json: {}) -> str:
continue continue
youtube_text = property_value[prop_value_name] youtube_text = property_value[prop_value_name]
return remove_html(youtube_text) return remove_html(youtube_text)
for property_value in actor_json['attachment']:
if not property_value.get('type'):
continue
prop_value_name, _ = \
get_attachment_property_value(property_value)
if not prop_value_name:
continue
if not property_value['type'].endswith('PropertyValue'):
continue
youtube_text = property_value[prop_value_name]
if 'youtube.com' not in youtube_text:
continue
return remove_html(youtube_text)
return '' return ''