[hitomi] set Referer header (fixes #239)

This commit is contained in:
Mike Fährmann 2019-05-01 10:54:42 +02:00
parent 5582b06ae4
commit 2756cc8dde
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -26,6 +26,11 @@ class HitomiGalleryExtractor(GalleryExtractor):
# "aa" subdomain for gallery-id ending in 1 (#142)
"pattern": r"https://aa\.hitomi\.la/",
}),
("https://hitomi.la/galleries/1401410.html", {
# download test
"range": "1",
"content": "b3ca8c6c8cc5826cf8b4ceb7252943abad7b8b4c",
}),
("https://hitomi.la/reader/867789.html"),
)
@ -68,6 +73,9 @@ class HitomiGalleryExtractor(GalleryExtractor):
subdomain = chr(97 + offset) + "a"
base = "https://" + subdomain + ".hitomi.la/galleries/"
# set Referer header before image downloads (#239)
self.session.headers["Referer"] = self.chapter_url
return [
(base + urlpart, None)
for urlpart in text.extract_iter(