Skip to content

Commit

Permalink
[mangahere] send Referer headers (#2592)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed May 15, 2022
1 parent 3fd9249 commit c8abb16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gallery_dl/extractor/mangahere.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class MangahereBase():
"""Base class for mangahere extractors"""
category = "mangahere"
root = "https://www.mangahere.cc"
mobile_root = "https://m.mangahere.cc"
url_fmt = mobile_root + "/manga/{}/{}.html"
root_mobile = "https://m.mangahere.cc"
url_fmt = root_mobile + "/manga/{}/{}.html"


class MangahereChapterExtractor(MangahereBase, ChapterExtractor):
Expand All @@ -42,6 +42,7 @@ def __init__(self, match):
self.part, self.volume, self.chapter = match.groups()
url = self.url_fmt.format(self.part, 1)
ChapterExtractor.__init__(self, match, url)
self.session.headers["Referer"] = self.root_mobile + "/"

def metadata(self, page):
pos = page.index("</select>")
Expand Down

0 comments on commit c8abb16

Please sign in to comment.