[exhentai] improve image limits check (#1808)

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.
This commit is contained in:
Mike Fährmann
2021-08-29 21:19:55 +02:00
parent 96fec14ef7
commit 57854624a1

View File

@@ -203,8 +203,8 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor):
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