Skip to content

Commit

Permalink
more reliable embed extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
zWolfrost committed Jan 16, 2025
1 parent 7a65aa2 commit 9f917a2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gallery_dl/extractor/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ def extract_default_message(self, message):
all_files.append(attachment)

for embed in message["embeds"]:
if embed["type"] == "gifv":
embed["url"] = embed["video"]["url"]
if embed["type"] in ("image", "gifv"):
if embed["type"] in ("image", "gifv", "video"):
embed["from"] = "embed"
if embed["type"] in ("image",):
embed["url"] = embed["thumbnail"]["proxy_url"]
elif embed["type"] in ("gifv", "video"):
embed["url"] = embed["video"]["proxy_url"]
all_files.append(embed)

for num, file in enumerate(all_files, start=1):
Expand Down

0 comments on commit 9f917a2

Please sign in to comment.