Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Trim Content-Type header to skip extra parts, #35
Browse files Browse the repository at this point in the history
This happens with HTML files for example:
text/html; charset=utf-8
  • Loading branch information
voyageur committed Jan 4, 2019
1 parent 29b2454 commit 8283ebc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dagr/dagr.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Dagr:
"""deviantArt gallery ripper class"""

NAME = basename(__file__)
__version__ = "0.71.1"
__version__ = "0.71.2"
MAX_DEVIATIONS = 1000000 # max deviations
ART_PATTERN = (r"https://www\.deviantart\.com/"
r"[a-zA-Z0-9_-]*/art/[a-zA-Z0-9_-]*")
Expand Down Expand Up @@ -157,7 +157,7 @@ def get(self, url, file_name=None):

if get_resp.headers.get("content-type"):
rename(file_name, file_name + guess_extension(
get_resp.headers.get("content-type")))
get_resp.headers.get("content-type").split(";")[0]))

return file_name

Expand Down

0 comments on commit 8283ebc

Please sign in to comment.