[bluesky] handle different 'embed' structure

This commit is contained in:
Mike Fährmann
2024-03-03 20:41:01 +01:00
parent 1115dccd0d
commit 6482bbc525
2 changed files with 14 additions and 2 deletions

View File

@@ -107,10 +107,14 @@ class BlueskyExtractor(Extractor):
post["width"] = post["height"] = 0
image = file["image"]
post["filename"] = link = image["ref"]["$link"]
try:
cid = image["ref"]["$link"]
except KeyError:
cid = image["cid"]
post["filename"] = cid
post["extension"] = image["mimeType"].rpartition("/")[2]
yield Message.Url, base + link, post
yield Message.Url, base + cid, post
def posts(self):
return ()