mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
10.76k stars 886 forks source link

[Kemono] Why one JSON file per file instead of one JSON file for the post itself? #5096

Open a84r7a3rga76fg opened 5 months ago

a84r7a3rga76fg commented 5 months ago

When enabling exporting metadata as JSON, it saves a JSON file for every downloadable file if you've set event to "prepare" because "post" doesn't keep track of the file order. Wouldn't it be better to create a JSON file for the entire post, or two JSON files if the post has revisions (one for latest and another for revisions)?

I downloaded this post with metadata enabled and it resulted in too many JSON files. It could've saved these as two JSON files and the same amount of information would've been preserved. https://kemono.su/api/v1/fanbox/user/884634/post/4845602 https://kemono.su/api/v1/fanbox/user/884634/post/4845602/revisions

mikf commented 5 months ago

Because you are using "event": "prepare", which triggers once per file. You could add "filer": "num == 1", but even then it would still not trigger for posts without a file if you care about that.