From 57854624a18825d5bbeaf85eb67c8490128c1790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 29 Aug 2021 21:19:55 +0200 Subject: [PATCH] [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. --- gallery_dl/extractor/exhentai.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/exhentai.py b/gallery_dl/extractor/exhentai.py index bccd6c84..aabfe6b5 100644 --- a/gallery_dl/extractor/exhentai.py +++ b/gallery_dl/extractor/exhentai.py @@ -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