Bionus / imgbrd-grabber

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

Tags are forgotten when determining target filename #1150

Closed FichteFoll closed 5 years ago

FichteFoll commented 6 years ago

What steps will reproduce the problem?

  1. Set template: %website%/%character% (%copyright%) by %artist%__%md5%.%ext%
  2. Search for any tag, e.g. panamaman on danbooru
  3. Click on an image.
  4. Click "save as"

What is the expected behavior? What do you get instead?

Problem: File is offered to be saved to unknown (misc) by anonymous__100127c9be7d67e1efa78f63630f78ad.jpg

Expected: unknown (original) by panamaman__100127c9be7d67e1efa78f63630f78ad.jpg

How often does this problem occur? On which sources?

Always, all tested (danbooru, konachan).

What version of the program are you using? On what operating system?

5.5.2 on Arch Linux. Also with some previous version (5.4.2+4) after which I attempted to upgrade, which didn't resolve the issue however.

Please provide any additional information below

When clicking on an image to load it, tags briefly appear on top of the image but disappear after a short while (~1s). The are rendered in the tooltip as well, with color coding. The log doesn't contain anything that would indicate an error. Only that it's loading and receiving tags.

My "Save" options ``` [Save] artist_empty=anonymous artist_multiple=keepNThenAdd artist_multiple_keepN=1 artist_multiple_keepNThenAdd_add=" (+ %count%)" artist_multiple_keepNThenAdd_keep=3 artist_multiple_limit=1 artist_sep=" " artist_useall=false artist_value=multiple artists automaticretries=0 character_empty=unknown character_multiple=keepNThenAdd character_multiple_keepN=1 character_multiple_keepNThenAdd_add=" (+ %count%)" character_multiple_keepNThenAdd_keep=5 character_multiple_limit=1 character_sep=" " character_value=group copyright_empty=misc copyright_multiple=keepNThenAdd copyright_multiple_keepN=1 copyright_multiple_keepNThenAdd_add=" (+ %count%)" copyright_multiple_keepNThenAdd_keep=3 copyright_multiple_limit=1 copyright_sep=" " copyright_useshorter=true copyright_value=crossover downloadoriginals=true filename=%website%/%character% (%copyright%) by %artist%__%md5%.%ext% filename_favorites= filename_real=%website%/%character% (%copyright%) by %artist%__%md5%.%ext% headerDetection=true keepDate=true keepDeletedMd5=false limit=0 md5Duplicates=move noJpeg=true path=/data/Images/Grabber path_favorites= path_real=/data/Images/Grabber replaceblanks=true samplefallback=true separator=" " simultaneous=1 species_empty=unknown species_multiple=keepAll species_multiple_keepN=1 species_multiple_keepNThenAdd_add=" (+ %count%)" species_multiple_keepNThenAdd_keep=1 species_multiple_limit=1 species_sep=+ species_value=multiple ```
Bionus commented 6 years ago

When clicking on an image to load it, tags briefly appear on top of the image but disappear after a short while (~1s).

This is definitely the root cause: the "Save" / "Save as" buttons will use the updated data which now has no tags, causing the wrong filename.

Background: when the image window is opened, the image's details page is loaded (in your example, https://danbooru.donmai.us/posts/2873376) and tags directly parsed from there (as this page gives more detailed information).

In your case, it seems that the query succeeded (otherwise the tags would not be updated at all after 1s) but the tag parsing failed. Since you said you tried on multiple sources, that's pretty strange. I personally cannot reproduce on either Danbooru or Konachan, even with your settings. Maybe it was caused by the big Danbooru upgrade? I know Danbooru was down yesterday again.

Does the log give any information about something that might have failed? (you can get some more logs with the -d flag when launching the program).

My "Save" options

First time I see someone other than myself use the <details> tag! ๐ŸŽ‰

FichteFoll commented 6 years ago

Does the log give any information about something that might have failed? (you can get some more logs with the -d flag when launching the program).

No, nothing.

``` [15:24:00.947][Debug] Loading https://api.github.com/repos/Bionus/imgbrd-grabber/releases/latest [15:24:01.611][Info] New session started. [15:24:01.611][Info] Software version: 5.5.2. [15:24:01.612][Info] Path: /usr/bin [15:24:01.612][Info] Loading preferences from /home/fichte/.Grabber/settings.ini [15:24:01.619][Info] Translating texts in English... [15:24:01.620][Debug] Loading sources [15:24:01.621][Info] No valid source has been found in the model.xml file from 4chan. [15:24:01.628][Info] No site for source Gelbooru (0.1) [15:24:01.634][Info] 20 sources found: behoimi.org (Danbooru), boards.4chan.org/a (4chan), boards.4chan.org/h (4chan), capi.sankakucomplex.com (Sankaku), chan.sankakucomplex.com (Sankaku), danbooru.donmai.us (Danbooru (2.0)), derpibooru.org (Booru-on-rails), e621.net (Danbooru), gelbooru.com (Gelbooru (0.2)), hijiribe.donmai.us (Danbooru (2.0)), ichijou.org (Danbooru), idol.sankakucomplex.com (Sankaku), konachan.com (Moebooru), rule34.paheal.net (Shimmie), rule34.xxx (Gelbooru (0.2)), safebooru.org (Gelbooru (0.2)), sonohara.donmai.us (Danbooru (2.0)), tentaclerape.net (Shimmie), www.zerochan.net (Zerochan), yande.re (Moebooru) [15:24:01.646][Debug] Updating settings for tab "Favorites". [15:24:01.647][Info] Updating checkboxes. [15:24:01.648][Info] [danbooru.donmai.us] Logging in... [15:24:01.654][Debug] Updating settings for tab "New tab". [15:24:01.654][Info] Updating checkboxes. [15:24:01.664][Debug] End of initialization [15:24:08.096][Info] Loading results... [15:24:08.098][Info] [danbooru.donmai.us][Html] Loading tags from page https://danbooru.donmai.us/posts?limit=20&page=1&tags=panamaman [15:24:08.098][Debug] Loading https://danbooru.donmai.us/posts?limit=20&page=1&tags=panamaman [15:24:08.100][Debug] Loading https://danbooru.donmai.us/posts.xml?limit=20&page=1&tags=panamaman [15:24:08.101][Info] [danbooru.donmai.us][Xml] Loading page https://danbooru.donmai.us/posts.xml?limit=20&page=1&tags=panamaman [15:24:08.801][Info] [danbooru.donmai.us][Html] Receiving tags page https://danbooru.donmai.us/posts?limit=20&page=1&tags=panamaman [15:24:09.075][Info] [danbooru.donmai.us][Xml] Receiving page https://danbooru.donmai.us/posts.xml?limit=20&page=1&tags=panamaman [15:24:09.084][Info] [danbooru.donmai.us][Xml] Parsed page https://danbooru.donmai.us/posts.xml?limit=20&page=1&tags=panamaman: 20 images, -1 total (-1), -1 pages (-1) [15:24:09.084][Debug] Loading https://danbooru.donmai.us/data/preview/100127c9be7d67e1efa78f63630f78ad.jpg [15:24:09.087][Debug] Loading https://danbooru.donmai.us/data/preview/c6b8828219cbe114d3a5a0778ceef93c.jpg [15:24:09.087][Debug] Loading https://danbooru.donmai.us/data/preview/e95a7b6bf3eff09e068b156a33b47e05.jpg [15:24:09.088][Debug] Loading https://danbooru.donmai.us/data/preview/be4db687f5a713f95f2727ebeab1761e.jpg [15:24:09.088][Debug] Loading https://danbooru.donmai.us/data/preview/4be2831f5b1346898f8fb3d225e6d269.jpg [15:24:09.089][Debug] Loading https://danbooru.donmai.us/data/preview/a9db36034cd5570d68f598138fa4e871.jpg [15:24:09.089][Debug] Loading https://danbooru.donmai.us/data/preview/133b1bdd74167cb035c5d8b62f2c0930.jpg [15:24:09.090][Debug] Loading https://danbooru.donmai.us/data/preview/ba30be81f2d32b865c55f7c2e6ddce47.jpg [15:24:09.090][Debug] Loading https://danbooru.donmai.us/data/preview/ff0b3b6e0d9c174ea82c2390a528facc.jpg [15:24:09.091][Debug] Loading https://danbooru.donmai.us/data/preview/ee6198436d81d8204d968ad0a59ed47c.jpg [15:24:09.091][Debug] Loading https://danbooru.donmai.us/data/preview/23bc1429a4f26492599a2d5661d35f5d.jpg [15:24:09.092][Debug] Loading https://danbooru.donmai.us/data/preview/f84167b838381d5c18161464755360d8.jpg [15:24:09.092][Debug] Loading https://danbooru.donmai.us/data/preview/8fbafdbc8063881f9c12a5b2b10b0b56.jpg [15:24:09.093][Debug] Loading https://danbooru.donmai.us/data/preview/9dba4f3edd92e98865dc31a09fb03ed5.jpg [15:24:09.093][Debug] Loading https://danbooru.donmai.us/data/preview/a0246ce4770ad328f6a2803bc5a95598.jpg [15:24:09.094][Debug] Loading https://danbooru.donmai.us/data/preview/df4bf73c172c421acc79db3e0c5f3d91.jpg [15:24:09.094][Debug] Loading https://danbooru.donmai.us/data/preview/b02e896da7c37570a7ccb06182c5a7ab.jpg [15:24:09.095][Debug] Loading https://danbooru.donmai.us/data/preview/63c9155992e0b108fb2f5854a42b4ef2.jpg [15:24:09.095][Debug] Loading https://danbooru.donmai.us/data/preview/02fb46573a0a81f2432bf19aa78edd4d.jpg [15:24:09.096][Debug] Loading https://danbooru.donmai.us/data/preview/d36b3facbb54eb901bd4a5d5f264919b.jpg [15:24:11.357][Debug] Loading https://danbooru.donmai.us/posts/2873376 [15:24:11.992][Info] Loading image from https://danbooru.donmai.us/data/__original_drawn_by_panamaman__100127c9be7d67e1efa78f63630f78ad.jpg [15:24:11.993][Debug] Loading https://danbooru.donmai.us/data/__original_drawn_by_panamaman__100127c9be7d67e1efa78f63630f78ad.jpg [15:24:12.006][Info] Image received from https://danbooru.donmai.us/data/__original_drawn_by_panamaman__100127c9be7d67e1efa78f63630f78ad.jpg [15:24:33.407][Debug] Opening options window... [15:27:53.393][Info] Loading results... [15:27:53.394][Info] [konachan.com][Html] Loading tags from page http://konachan.com/post/index?login=&password_hash=&limit=20&page=1&tags=panamaman [15:27:53.394][Info] [konachan.com] Logging in... [15:27:53.395][Debug] Loading http://konachan.com/post/index?login=&password_hash=&limit=20&page=1&tags=panamaman [15:27:53.395][Debug] Loading http://konachan.com/post/index.xml?login=&password_hash=&limit=20&page=1&tags=panamaman [15:27:53.398][Info] [konachan.com][Xml] Loading page http://konachan.com/post/index.xml?login=&password_hash=&limit=20&page=1&tags=panamaman [15:27:54.156][Info] [konachan.com][Xml] Receiving page http://konachan.com/post/index.xml?login=&password_hash=&limit=20&page=1&tags=panamaman [15:27:54.162][Info] [konachan.com][Xml] Parsed page http://konachan.com/post/index.xml?login=&password_hash=&limit=20&page=1&tags=panamaman: 18 images, 18 total (18), 1 pages (1) [15:27:54.163][Debug] Loading http://konachan.com/data/preview/35/92/35924bfc0dc7407f3215e917123b5499.jpg [15:27:54.165][Debug] Loading http://konachan.com/data/preview/46/42/46422093ee85c6c1046a920cdd09bfd9.jpg [15:27:54.166][Debug] Loading http://konachan.com/data/preview/69/86/6986f6135de8a2a32cb66d4975bc9529.jpg [15:27:54.168][Debug] Loading http://konachan.com/data/preview/63/29/6329ebdb89e4847b50bff2e841663ab3.jpg [15:27:54.169][Debug] Loading http://konachan.com/data/preview/62/ed/62ed4c7915ee2b511990484f32513a8b.jpg [15:27:54.170][Debug] Loading http://konachan.com/data/preview/66/b2/66b290ec5eada649d2e758d8bc26a0a0.jpg [15:27:54.171][Debug] Loading http://konachan.com/data/preview/d8/4b/d84b23ef52dc317212c696c91a18041e.jpg [15:27:54.172][Debug] Loading http://konachan.com/data/preview/41/cd/41cd4038903a2beaa1ba4e5f2c42abdf.jpg [15:27:54.173][Debug] Loading http://konachan.com/data/preview/32/0e/320eb265768b968519ab2a0fa695b06c.jpg [15:27:54.174][Debug] Loading http://konachan.com/data/preview/23/bc/23bc1429a4f26492599a2d5661d35f5d.jpg [15:27:54.175][Debug] Loading http://konachan.com/data/preview/7c/22/7c226980d903eb4dc33d2c16ecde036a.jpg [15:27:54.176][Debug] Loading http://konachan.com/data/preview/ba/30/ba30be81f2d32b865c55f7c2e6ddce47.jpg [15:27:54.177][Debug] Loading http://konachan.com/data/preview/b0/2e/b02e896da7c37570a7ccb06182c5a7ab.jpg [15:27:54.178][Debug] Loading http://konachan.com/data/preview/0c/6e/0c6ec50bfe3a0a01fc7d185bce5c2d35.jpg [15:27:54.179][Debug] Loading http://konachan.com/data/preview/23/44/2344561819871520401235e3fa00c010.jpg [15:27:54.180][Debug] Loading http://konachan.com/data/preview/ae/83/ae83972e283043e9f1c4347c4908110a.jpg [15:27:54.181][Debug] Loading http://konachan.com/data/preview/6e/a6/6ea6a66c4bf1240892242f7226a54dbd.jpg [15:27:54.183][Debug] Loading http://konachan.com/data/preview/d3/6b/d36b3facbb54eb901bd4a5d5f264919b.jpg [15:27:55.150][Info] [konachan.com][Html] Receiving tags page http://konachan.com/post/index?login=&password_hash=&limit=20&page=1&tags=panamaman [15:27:56.316][Debug] Loading http://konachan.com/post/show/225959 [15:27:56.923][Info] Loading image from http://konachan.com/image/35924bfc0dc7407f3215e917123b5499/Konachan.com - 225959 2girls aqua_eyes armor gloves headdress original panamaman twins white_hair.jpg [15:27:56.924][Debug] Loading http://konachan.com/image/35924bfc0dc7407f3215e917123b5499/Konachan.com - 225959 2girls aqua_eyes armor gloves headdress original panamaman twins white_hair.jpg [15:27:57.392][Info] Image received from http://konachan.com/image/35924bfc0dc7407f3215e917123b5499/Konachan.com - 225959 2girls aqua_eyes armor gloves headdress original panamaman twins white_hair.jpg ```

On the console, however, I was able to observe this:

QObject::disconnect: Unexpected null parameter
QMetaObject::connectSlotsByName: No matching signal for on_buttonImageBackgroundColor_textChanged()
QCoreApplication::postEvent: Unexpected null receiver
QObject::disconnect: Unexpected null parameter

The null parameter messages pops up when opening an image window (but immediately, not after 1s when tags disappear).

The connectSlotsByName messages appears when opening the options dialog.

I forgot when the other message was shown.

First time I see someone other than myself use the <details> tag! ๐ŸŽ‰

I initially posted without using it but then remembered that it existed for this purpose while having dinner. ๐Ÿ‘

FichteFoll commented 5 years ago

I tested this again today with v7.1.1.r3.1254e59f-1 (after I nuked and reapplied my config because Grabber wouldn't start otherwise) and it works.