Skip to content

Commit

Permalink
[hitomi] set Referer header (fixes #239)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed May 1, 2019
1 parent 5582b06 commit 2756cc8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gallery_dl/extractor/hitomi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
)

Expand Down Expand Up @@ -68,6 +73,9 @@ def images(self, page):
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(
Expand Down

0 comments on commit 2756cc8

Please sign in to comment.