Skip to content

Commit

Permalink
[exhentai] improve image limits check (#1808)
Browse files Browse the repository at this point in the history
Check for a 'text/html' Content-Type instead of the very specific
137 bytes Content-Length, which might change depending on compression
or other factors.
  • Loading branch information
mikf committed Aug 29, 2021
1 parent 96fec14 commit 5785462
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gallery_dl/extractor/exhentai.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def items(self):

def _validate_response(response):
# declared inside 'items()' to be able to access 'data'
if not response.history and \
response.headers.get("content-length") == "137":
if not response.history and response.headers.get(
"content-type", "").startswith("text/html"):
self._report_limits(data)
return True

Expand Down

0 comments on commit 5785462

Please sign in to comment.