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