[mangasee] use randomly generated PHPSESSID cookie (#2560)

This commit is contained in:
Mike Fährmann 2022-05-05 19:31:08 +02:00
parent 4c47dfffdd
commit f190018e37
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -9,7 +9,7 @@
"""Extractors for https://mangasee123.com/"""
from .common import ChapterExtractor, MangaExtractor
from .. import text
from .. import text, util
import json
@ -57,6 +57,15 @@ class MangaseeChapterExtractor(MangaseeBase, ChapterExtractor):
},
})
def __init__(self, match):
ChapterExtractor.__init__(self, match)
self.session.headers["Referer"] = self.gallery_url
domain = "mangasee123.com"
cookies = self.session.cookies
if not cookies.get("PHPSESSID", domain=domain):
cookies.set("PHPSESSID", util.generate_token(13), domain=domain)
def metadata(self, page):
extr = text.extract_from(page)
self.chapter = data = json.loads(extr("vm.CurChapter =", ";\r\n"))