diff options
| author | 2023-01-11 04:09:13 -0500 | |
|---|---|---|
| committer | 2023-01-11 04:09:13 -0500 | |
| commit | fe385c3ff784ba3d19454a35446502c0ec295893 (patch) | |
| tree | 897982793ef2a0c0f349044bf4cf803ccd483e6e /gallery_dl/extractor/fanbox.py | |
| parent | ebdfcd3cd3f76534a590ba08933ff7ea54813316 (diff) | |
New upstream version 1.24.3.upstream/1.24.3
Diffstat (limited to 'gallery_dl/extractor/fanbox.py')
| -rw-r--r-- | gallery_dl/extractor/fanbox.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gallery_dl/extractor/fanbox.py b/gallery_dl/extractor/fanbox.py index f692a90..41431dc 100644 --- a/gallery_dl/extractor/fanbox.py +++ b/gallery_dl/extractor/fanbox.py @@ -69,14 +69,28 @@ class FanboxExtractor(Extractor): if post["type"] == "article": post["articleBody"] = content_body.copy() if "blocks" in content_body: - content = [] + content = [] # text content + images = [] # image IDs in 'body' order + append = content.append + append_img = images.append for block in content_body["blocks"]: if "text" in block: append(block["text"]) if "links" in block: for link in block["links"]: append(link["url"]) + if "imageId" in block: + append_img(block["imageId"]) + + if images and "imageMap" in content_body: + # reorder 'imageMap' (#2718) + image_map = content_body["imageMap"] + content_body["imageMap"] = { + image_id: image_map[image_id] + for image_id in images + } + post["content"] = "\n".join(content) post["date"] = text.parse_datetime(post["publishedDatetime"]) @@ -294,6 +308,10 @@ class FanboxPostExtractor(FanboxExtractor): r"Thank you for your continued support of FANBOX.$", }, }), + # imageMap file order (#2718) + ("https://mochirong.fanbox.cc/posts/3746116", { + "url": "c92ddd06f2efc4a5fe30ec67e21544f79a5c4062", + }), ) def __init__(self, match): |
