[kemonoparty] send Referer headers (#2989, #2990)

This commit is contained in:
Mike Fährmann
2022-09-30 22:38:56 +02:00
parent 98f67ae333
commit b84982b2f9

View File

@@ -33,6 +33,7 @@ class KemonopartyExtractor(Extractor):
self.cookiedomain = ".coomer.party" self.cookiedomain = ".coomer.party"
self.root = text.root_from_url(match.group(0)) self.root = text.root_from_url(match.group(0))
Extractor.__init__(self, match) Extractor.__init__(self, match)
self.session.headers["Referer"] = self.root + "/"
def items(self): def items(self):
self._prepare_ddosguard_cookies() self._prepare_ddosguard_cookies()
@@ -63,6 +64,8 @@ class KemonopartyExtractor(Extractor):
for post in posts: for post in posts:
headers["Referer"] = "{}/{}/user/{}/post/{}".format(
self.root, post["service"], post["user"], post["id"])
post["_http_headers"] = headers post["_http_headers"] = headers
post["date"] = text.parse_datetime( post["date"] = text.parse_datetime(
post["published"] or post["added"], post["published"] or post["added"],