Skip to content

Commit

Permalink
[downloader] fix extension from content-type
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jun 19, 2017
1 parent e68af4f commit fac6c02
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gallery_dl/downloader/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def download_impl(self, url, pathfmt):
if not pathfmt.has_extension:
# set 'extension' keyword from Content-Type header
mtype = response.headers.get("Content-Type", "image/jpeg")
mtype = mtype.partition(";")[0]
exts = mimetypes.guess_all_extensions(mtype, strict=False)
if exts:
exts.sort()
Expand Down

0 comments on commit fac6c02

Please sign in to comment.