[jaiminisbox] update decoding procedure (fixes #702)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright 2016-2019 Mike Fährmann
|
# Copyright 2016-2020 Mike Fährmann
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License version 2 as
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -19,6 +19,7 @@ from .common import (
|
|||||||
from .. import text, util
|
from .. import text, util
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
class FoolslideBase(SharedConfigMixin):
|
class FoolslideBase(SharedConfigMixin):
|
||||||
@@ -85,7 +86,12 @@ class FoolslideChapterExtractor(FoolslideBase, ChapterExtractor):
|
|||||||
data = None
|
data = None
|
||||||
|
|
||||||
if self.decode == "base64":
|
if self.decode == "base64":
|
||||||
base64_data = text.extract(page, 'atob("', '"')[0]
|
pos = page.find("'fromCharCode'")
|
||||||
|
if pos >= 0:
|
||||||
|
blob = text.extract(page, "'", "'", pos+15)[0]
|
||||||
|
base64_data = re.sub(r"[a-zA-Z]", _decode_jaiminisbox, blob)
|
||||||
|
else:
|
||||||
|
base64_data = text.extract(page, 'atob("', '"')[0]
|
||||||
if base64_data:
|
if base64_data:
|
||||||
data = base64.b64decode(base64_data.encode()).decode()
|
data = base64.b64decode(base64_data.encode()).decode()
|
||||||
elif self.decode == "double":
|
elif self.decode == "double":
|
||||||
@@ -120,6 +126,16 @@ class FoolslideMangaExtractor(FoolslideBase, MangaExtractor):
|
|||||||
})))
|
})))
|
||||||
|
|
||||||
|
|
||||||
|
def _decode_jaiminisbox(match):
|
||||||
|
c = match.group(0)
|
||||||
|
|
||||||
|
# ord("Z") == 90, ord("z") == 122
|
||||||
|
N = 90 if c <= "Z" else 122
|
||||||
|
C = ord(c) + 13
|
||||||
|
|
||||||
|
return chr(C if N >= C else (C - 26))
|
||||||
|
|
||||||
|
|
||||||
EXTRACTORS = {
|
EXTRACTORS = {
|
||||||
"dokireader": {
|
"dokireader": {
|
||||||
"root": "https://kobato.hologfx.com/reader",
|
"root": "https://kobato.hologfx.com/reader",
|
||||||
|
|||||||
Reference in New Issue
Block a user