Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Nozomi] preserving image order for multi-image posts #1239

Closed
oxi7589 opened this issue Jan 10, 2021 · 3 comments
Closed

[Nozomi] preserving image order for multi-image posts #1239

oxi7589 opened this issue Jan 10, 2021 · 3 comments

Comments

@oxi7589
Copy link

oxi7589 commented Jan 10, 2021

There seems to be no way to easily preserve image order in nozomi.la's posts which contain several images.

Here is a decent enough (NSFW) example demonstrating the issue: https://nozomi.la/post/16456253.html

>gallery-dl.exe https://nozomi.la/post/16456253.html
* .\gallery-dl\nozomi\16456253 b28b8da6d48af73ebef7c9043567be3ef4566faf90745f3b4394308510c5b955.jpg
* .\gallery-dl\nozomi\16456253 7f6e1d65fe9ef2d9969643afbfaf0a87857542cc68e22a9dc647b4dbfe4bdf17.jpg
* .\gallery-dl\nozomi\16456253 62a6983eef0b1711e966a9b9508235d34a2464b20d9ff72871e1a4cc6d18c45f.jpg
* .\gallery-dl\nozomi\16456253 31c6abf815db94a554aae3d0324b907e3b409fc27c61388599b9875597e50578.jpg
* .\gallery-dl\nozomi\16456253 dfcd79bb860cd041d58bbbf869bb5579fec9f3839b289493783224ce61959ebf.jpg

The download order corresponds to the best viewing order (hopefully, this is by design and is not an implementation detail that may break any time).

But, obliviously, when filenames are sorted alphanumerically, it's all messed up. Sorting by date makes even less sense, since gallery-dl messes with modification dates so they are all the same.

Running >gallery-dl -K https://nozomi.la/post/16456253.html results in nothing that looks like image number within the post.
--write-metadata doesn't help either -- the jsons are identical except for "dataid", "filename" and "url" (all being variations of the same thing), so cannot be used to restore the order.

So my question is, is there a better way to preserve the sequence order, other than hacky and hard to automate "copy gallery-dl's output and build a rename script from that"?

@mikf
Copy link
Owner

mikf commented Jan 11, 2021

Would adding an enumeration index work for you, so you could have 16456253_01.jpg, 16456253_02.jpg, etc as filenames? Is it OK if those are there even if a post only has one file?

since gallery-dl messes with modification dates so they are all the same

Can be disabled with downloader.mtime or --no-mtime.

@oxi7589
Copy link
Author

oxi7589 commented Jan 12, 2021

Would adding an enumeration index work for you, so you could have 16456253_01.jpg, 16456253_02.jpg, etc as filenames? Is it OK if those are there even if a post only has one file?

Yes, that sounds like a good solution. An extra index wouldn't hurt for single-page posts, and it will make sorting multi-image ones a lot easier.

@mikf mikf closed this as completed in 318876e Jan 14, 2021
@mikf
Copy link
Owner

mikf commented Jan 14, 2021

Add {num} (or e.g. {num:>02}) to the filename format string and you'll have ordered images in multi-file posts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants