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

[yandere] pool title #4646

Open
dajotim937 opened this issue Oct 9, 2023 · 6 comments
Open

[yandere] pool title #4646

dajotim937 opened this issue Oct 9, 2023 · 6 comments

Comments

@dajotim937
Copy link

dajotim937 commented Oct 9, 2023

https://yande.re/pool/show/98590
gallery-dl.exe https://yande.re/pool/show/98590 -K doesn't have any tag (I wanted for directory) that would contain title of pool: "Megami #⁠279 2023-08"

And also for some extractors (like submission on reddit that contains gallery) gallery-dl has num field. Is it possible to add for yandere pools also?

mikf added a commit that referenced this issue Oct 13, 2023
for extended 'pool' metadata
@mikf
Copy link
Owner

mikf commented Oct 13, 2023

Enable metadata and you'll get extended pool metadata, with title in {pool[title]}.
This does not work for all moebooru instances, but it does for yande.re.

@mikf
Copy link
Owner

mikf commented Oct 13, 2023

And also for some extractors (like submission on reddit that contains gallery) gallery-dl has num field. Is it possible to add for yandere pools also?

It's "possible", but it wouldn't be pretty and the order would probably be wrong as well ...
I'd rather add some form of generic enumeration.

@dajotim937
Copy link
Author

dajotim937 commented Oct 13, 2023

What do you mean by "order would probably be wrong"? Are the pics returned in a different order than they appear on site?

Yeah, too many booru instances. I was looking at config for *.[booru].* so didn't notice that metadata option.
But, for some reason, "pool": {"metadata": true} nor "pool.metadata":true still doesn't return extended metadata.
Full config for extractor:
removed

I'm stupid and didn't notice a new commit.=)

@mikf
Copy link
Owner

mikf commented Oct 14, 2023

What do you mean by "order would probably be wrong"? Are the pics returned in a different order than they appear on site?

I don't know if this is also the case for moebooru instances, but for a pool:POOLID tag search danbooru returns posts in descending ID order. It needs the special ordpool:POOLID to return posts in pool order. moebooru instances / yande.re don't seem to have an ordpool equivalent.

@mikf
Copy link
Owner

mikf commented Oct 14, 2023

Regarding enumerating (pool) posts: It is possible to (ab)use python post processors to at least provide an enumeration index for filenames.

  1. Create a new gdl_utils.py file (or use whatever name) with this inside:
num = 0

def num_init(kwdict):
    global num
    num = 0

def num_inc(kwdict):
    global num
    num += 1
    kwdict["num"] = num
  1. Call these functions with python post processors
    "postprocessors": [
        {
            "name": "python",
            "event": "init",
            "function": "/tmp/_/gdl_utils.py:num_init"
        },
        {
            "name": "python",
            "event": "post",
            "function": "/tmp/_/gdl_utils.py:num_inc"
        }
    ]

(replace "/tmp/_/gdl_utils.py" with the actual path)

Result:

$ gallery-dl -f "{num:>02}.{extension}" https://yande.re/pool/show/98680
/tmp/_/yandere/pool/98680/01.png
/tmp/_/yandere/pool/98680/02.png
/tmp/_/yandere/pool/98680/03.png
/tmp/_/yandere/pool/98680/04.png
/tmp/_/yandere/pool/98680/05.png
/tmp/_/yandere/pool/98680/06.png
/tmp/_/yandere/pool/98680/07.png

@dajotim937
Copy link
Author

dajotim937 commented Oct 14, 2023

What do you mean by "order would probably be wrong"? Are the pics returned in a different order than they appear on site?

I don't know if this is also the case for moebooru instances, but for a pool:POOLID tag search danbooru returns posts in descending ID order. It needs the special ordpool:POOLID to return posts in pool order. moebooru instances / yande.re don't seem to have an ordpool equivalent.

Well, yandere doesn't return post inside a pool ordered by id. Not in pool/show/ID nor in search with pool:ID. You can see that in my pool link (same order if you are using search /post?tags=pool%3A98590 and json): 1101176, 1101177, 1101179, 1101178, 1101182, 1101183, 1101181, 1101180, 1101184, 1101185, 1101190, 1101187, 1101189, 1101188, 1101191, 1101192, 1101567, 1101568.

So I thought about just enumeration from gallery-dl. Which one post returned in pool first gets 1, second - 2, etc.

Danbooru inside pool (/pools/ID) looks like also return in pool order (also in /pools/ID.json too). Well, if for pools you are using search to download, than I get what's the issue. I'll use your workaround then.

Update: checked Moebooru and MyImouto sites from SupportedSites.md:
sakugabooru: pool 141, /post?tags=pool%3A141 and /pool/show/141 and /pool/show/141.json return same order like in pool, not by id;
konachan: pool 415, /post?tags=pool%3A415 and /pool/show/415 both return same order like in pool, not by id and doesn't have /pool/show/id.json;
lolibooru: pool 304, doesn't have search with pool:ID and /pool/show/id.json but return order here: https://lolibooru.moe/pool/show.json?id=ID

Don't know if any of this is useful for you.

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