replace json.loads with direct calls to JSONDecoder.decode

This commit is contained in:
Mike Fährmann
2023-02-07 23:14:53 +01:00
parent b7337d810e
commit dd884b02ee
42 changed files with 117 additions and 154 deletions

View File

@@ -7,8 +7,7 @@
"""Extractors for https://nana.my.id/"""
from .common import GalleryExtractor, Extractor, Message
from .. import text, exception
import json
from .. import text, util, exception
class NanaGalleryExtractor(GalleryExtractor):
@@ -59,7 +58,7 @@ class NanaGalleryExtractor(GalleryExtractor):
}
def images(self, page):
data = json.loads(text.extr(page, "Reader.pages = ", ".pages"))
data = util.json_loads(text.extr(page, "Reader.pages = ", ".pages"))
return [
("https://nana.my.id" + image, None)
for image in data["pages"]