Skip to content

Commit

Permalink
[instagram] fix 'extensiob' of apparent '.webp' files (#6541)
Browse files Browse the repository at this point in the history
Many '.webp' download URLs are actually '.jpg' files, which usually get
renamed by 'http.adjust-extensions'
  • Loading branch information
mikf committed Nov 28, 2024
1 parent 7c7b8a2 commit 5cc9ca7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gallery_dl/extractor/instagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ def items(self):
continue

url = file["display_url"]
yield Message.Url, url, text.nameext_from_url(url, file)
text.nameext_from_url(url, file)
if file["extension"] == "webp" and "stp=dst-jpg" in url:
file["extension"] = "jpg"
yield Message.Url, url, file

def metadata(self):
return ()
Expand Down

0 comments on commit 5cc9ca7

Please sign in to comment.