mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Mastodon: Prefer remote_url before instance cached URL when playing media files
This commit is contained in:
parent
c6796874c2
commit
0764679164
@ -54,7 +54,11 @@ def get_media_urls(post):
|
||||
urls = []
|
||||
for media in post.media_attachments:
|
||||
if media.get("type") == "audio" or media.get("type") == "video":
|
||||
urls.append(media.get("url"))
|
||||
url_keys = ["remote_url", "url"]
|
||||
for url_key in url_keys:
|
||||
if media.get(url_key) != None:
|
||||
urls.append(media.get(url_key))
|
||||
break
|
||||
return urls
|
||||
|
||||
def find_urls(post, include_tags=False):
|
||||
|
Loading…
Reference in New Issue
Block a user