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

Some small issues with saving images. #487

Open Falord opened 8 years ago

Falord commented 8 years ago

Thanks for fixing e621's API format, but it seems the image viewers 'Save', 'Save and close' and 'Save as...' is now broken for a couple sources (e621, rule34booru,danbooru,hijiribe.donmai and safebooru for sure aren't working. rule34.paheal, gelbooru and ichijou still works though). If you try, it well still create the folders like always if it doesn't exist, but well not create the image in said folder anymore.

I love the custom token feature, but there's one problem I have with it apart from it being case sensitive. It creates spaces in the file name of images for each token that it did not find any tags set to it. For example e621 has pokemon and digimon set as general tags, not character, so I created a token to hold there names. Now if no pokemon is in the image downloading, it well return a space for the token. This adds up if your using multiple tokens to cover the tags you want, instead of one massive token. I would love that tokens don't create spaces if they don't find there tags. I guessed using conditional tokens would have been my best bet, but can't use them since it give me a warning about not using these characters <>. Maybe I'm just using them wrong.

In Options - Save - 'Conditionnal' Filenames - Add conditional filename. The text in here in the English install is not in English, but French. This is only in the current version. In version 4.21 it's in English.

This is more a question: What those the 'Save as...' naming system function under? Only on rule34.paheal images, if you use the Save as... option on an open image from this source, you get the all the tags from that image. I know rule34.paheal create that tag system while saving images from there normally, but Is there anyway to forces that option while doing a batch download in grabber?

Bionus commented 8 years ago

What filename are you using? I can't reproduce. Could you also upload the log file of right after the "Save" button doesn't work?

I love the custom token feature, but there's one problem I have with it apart from it being case sensitive.

Would you rather have it case insensitive? It can be done.

It creates spaces in the file name of images for each token that it did not find any tags set to it. For example e621 has pokemon and digimon set as general tags, not character, so I created a token to hold there names. Now if no pokemon is in the image downloading, it well return a space for the token. This adds up if your using multiple tokens to cover the tags you want, instead of one massive token. I would love that tokens don't create spaces if they don't find there tags. I guessed using conditional tokens would have been my best bet, but can't use them since it give me a warning about not using these characters <>. Maybe I'm just using them wrong.

Conditional tokens would have indeed be the best solution (or even conditional filenames). But not necessarily. Custom tokens do not (or at least should not, I tried and they didn't here) leave spaces (" "), but just be replaced by nothing (""). Are you sure your filename is not the cause? For example, if you use "%character% %pokemon% %digimon% %md5%.%ext%", the fact that the %digimon% token is replaced by nothing will make the filename look like "%character% %pokemon% %md5%.%ext%", therefore with two spaces. One option (since these two tokens are exclusive) would be to stick them together ("%pokemon%%digimon%"), or as you said using conditional tokens: "<%character% ><%pokemon% ><%digimon% >%md5%.%ext%" where each space is dependent on the presence of the custom token. It indeed seems that conditional tokens generate warnings though, but feel free to ignore them! My bad. :smile:

In Options - Save - 'Conditionnal' Filenames - Add conditional filename. The text in here in the English install is not in English, but French. This is only in the current version. In version 4.21 it's in English.

Indeed, I thought I translated the new fields but seems like it didn't.

What those the 'Save as...' naming system function under? Only on rule34.paheal images, if you use the Save as... option on an open image from this source, you get the all the tags from that image. I know rule34.paheal create that tag system while saving images from there normally, but Is there anyway to forces that option while doing a batch download in grabber?

I'm not sure I understand, but currently, the "Save as..." button uses as filename the original filename (%filename%.%ext%, not the one you might have set in the settings). What you would want is to use your own filename?

Falord commented 8 years ago

Ok for the save problem. Full log.txt Did a fresh log and in this test a little random, but downloads 1, 3, 5, 6, 7, 8, 10, 12 all saved there images across some sources on my system, the others in this list did not produce a image, but they did produce there "separate text file" with all the correct tags. This problem isn't present in version 4.21 for any of the sources I mentioned excluding e621 which no longer works in that version.

The case sensitive thing just caught me of guard as to why the custom tokens were not working the first time i used it to creating my pokemon token where every name had a capital letter. A little warning text for people new to grabber in there would be nice.

For the token problem, I tried using the <> even with the error message and made all my tags like <%tag%><%tag%>. It worked to remove the spaces. Sadly it removed every space including the space between words when used, then I did it with spaces like this <%tag% ><%tag% > and it reproduced my original problem of creating spaces for each token that didn't find its tags. not sure whats going on my end with this.

The "Save as..." thing I was talking about was for rule34.paheal only, since grabber can not grab tags from this sources, since it doesn't follow any tagging rules. But rule34.paheal names all there images and I didn't know if there was a token to grab just that name in grabber. %filename% was the answer I was looking for. I though %filename% was like %md5% after using it on a couple sources and get back a long string of numbers.

Bionus commented 8 years ago

By log I actually meant the main.log file located in "%localappdata%/Bionus/Grabber".

As for your custom tag problem, I'll need more information, especially the filename format you're using, plus one of your custom tokens. Because "<%tag% >" should produce nothing ("") when %tag% is empty.

For %filename%, it's actually just the filename as on the website's server. Depending on the source, it might be the MD5, the tags or something else.

Falord commented 8 years ago

Then this right? main.txt Hope version 4.21 did not change it to much since it's using the same log.

Well I use a lot of tokens, this is my token set up minus one token cause it's name. %id% %artist% %copyright% %character% %GenderK% %Kingbelly% %Little Friend% %SpeciesA% %SpecialD% %To_cute% %Bad_day_ladys% %rating% %website%.%ext% This is also the filename I use for all downloads. If I used <%tag%> all spaces go away, if I use <%tag% > the original problem returns.