Skip to content

Commit

Permalink
[mangasee] use randomly generated PHPSESSID cookie (#2560)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed May 5, 2022
1 parent 4c47dff commit f190018
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gallery_dl/extractor/mangasee.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""Extractors for https://mangasee123.com/"""

from .common import ChapterExtractor, MangaExtractor
from .. import text
from .. import text, util
import json


Expand Down Expand Up @@ -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"))
Expand Down

0 comments on commit f190018

Please sign in to comment.