[mangahere] send Referer headers (#2592)

This commit is contained in:
Mike Fährmann 2022-05-14 23:20:46 +02:00
parent 3fd9249717
commit c8abb16c60
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -17,8 +17,8 @@ class MangahereBase():
"""Base class for mangahere extractors""" """Base class for mangahere extractors"""
category = "mangahere" category = "mangahere"
root = "https://www.mangahere.cc" root = "https://www.mangahere.cc"
mobile_root = "https://m.mangahere.cc" root_mobile = "https://m.mangahere.cc"
url_fmt = mobile_root + "/manga/{}/{}.html" url_fmt = root_mobile + "/manga/{}/{}.html"
class MangahereChapterExtractor(MangahereBase, ChapterExtractor): class MangahereChapterExtractor(MangahereBase, ChapterExtractor):
@ -42,6 +42,7 @@ class MangahereChapterExtractor(MangahereBase, ChapterExtractor):
self.part, self.volume, self.chapter = match.groups() self.part, self.volume, self.chapter = match.groups()
url = self.url_fmt.format(self.part, 1) url = self.url_fmt.format(self.part, 1)
ChapterExtractor.__init__(self, match, url) ChapterExtractor.__init__(self, match, url)
self.session.headers["Referer"] = self.root_mobile + "/"
def metadata(self, page): def metadata(self, page):
pos = page.index("</select>") pos = page.index("</select>")