Bionus / imgbrd-grabber

Very customizable imageboard/booru downloader with powerful filenaming features.
https://www.bionus.org/imgbrd-grabber/
Apache License 2.0
2.52k stars 216 forks source link

How to pick character tag with post that has multiple character tags? #2669

Open maslos opened 2 years ago

maslos commented 2 years ago

Hello,

Thank you very much for your work, and i got a question:

If file has multiple character tags, for ex. name1, name2, how can I save file as only name2? I only found option to either replace all tags or add them so name is name1 + name2, but i only want name2.

Thank you in advance :)

Bionus commented 2 years ago

Hello

How can Grabber know you don't want "name1"? You can say "keep 1 tag" but then it'll only take the first one, so in your example, "name1" (in the place you already found, I guess).

If you really don't want "name1", you can add it to your list of "removed tags" in the settings. But that'll only apply to "name1", and not, let's say, "name3".

maslos commented 2 years ago

So there is no switch that will pick specific tag (ex. %character2%, or second %character% tag in line as only used tag? Well then, i gona stick to first one only ^^

Bionus commented 2 years ago

But why the second one in particular? And what if there's only one? Is there some particular logic/meaning to wanting the second one? 🤔

maslos commented 2 years ago

Second tag is just an example, the case is that some characters have their alter egos/skins thats also listed in tag list, and cause of that folder/filename becomes unnecessary long when Grabber combines all the tags.

Also what if there are multiple characters in image? In means its a group photo or something, if by mistake i will try to download a photo that has 20 characters, the filename will become nuts :)

Kougami901 commented 1 year ago

Is there some particular logic/meaning to wanting the second one? 🤔

Actually yes, if I want to retain all possible characters (or most of them) in the filename itself, (i.e. char_a+char_b+char_c.jpg), while also keeping the filepath itself as simple as possible and still being somewhat automated.

If I'm using %character% on the path, the directory specified in Settings/Save/Folder will be clogged up fast if there are more than a handful of images that have >1 character tagged:

%websitename%/%character%/%artist%__%character%.%ext%

example-page.com
├── flandre_scarlet-sakuya_izayoi-yukari_yakumo-marisa_kirisame
│   └── artist1__flandre_scarlet-sakuya_izyaoi-yukari_yukamo-marisa_kirisame.jpg
├── flandre_scarlet-cirno-yukari_yukamo-marisa_kirisame
│   └── artist1__flandre_scarlet-cirno-yukari_yukamo-marisa_kirisame.jpg
├── flandre_scarlet-yukari_yukamo-ran_yakumo
│   └── artist1__flandre_scarlet-yukari_yukamo-ran_yakumo.jpg
│   └── artist2__flandre_scarlet-yukari_yukamo-ran_yakumo.jpg
├── flandre_scarlet-....
│   └── ....

Imo it would be nice to have the option to specify the character, artist, ... tags with an index, like with arrays. So for example %character[0]%; %character:[0]%; %character:0% - or something along these lines. Then one could adjust the Filename like this, which would result in a far more readable folder structure:

%websitename%/%character[0]%/%artist%__%character%.%ext%

example-page.com
└── flandre_scarlet
    └── artist1__flandre_scarlet-sakuya_izyaoi-yukari_yukamo-marisa_kirisame.jpg
    └── artist1__flandre_scarlet-cirno-yukari_yukamo-marisa_kirisame.jpg
    └── artist1__flandre_scarlet-yukari_yukamo-ran_yakumo.jpg
    └── artist2__flandre_scarlet-yukari_yukamo-ran_yakumo.jpg
    └── ....

That should be good enough to cover 99% of cases where this is needed. Although an adjustable, per-tag character (as in: the data type) limitation would be nice to have in this case, to limit only that value to char(n), as to not overwhelm certain file explorers, while still being able to keep other tags at the end like %id%, %md5%, etc.