Added playback of audio and video attachments in toots

This commit is contained in:
2022-11-09 13:07:59 -06:00
parent edbc74262a
commit 59409e61a5
2 changed files with 24 additions and 4 deletions

View File

@@ -33,4 +33,11 @@ def is_image(toot):
# Checks firstly for Mastodon native videos and audios.
for media in toot.media_attachments:
if media["type"] == "gifv" or media["type"] == "image":
return True
return True
def get_media_urls(toot):
urls = []
for media in toot.media_attachments:
if media.get("type") == "audio" or media.get("type") == "video":
urls.append(media.get("url"))
return urls