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

IQDB 403 error on upload page #360

Open
nuenuewei opened this issue Jan 28, 2024 · 4 comments · May be fixed by #382
Open

IQDB 403 error on upload page #360

nuenuewei opened this issue Jan 28, 2024 · 4 comments · May be fixed by #382
Labels
bug Something isn't working

Comments

@nuenuewei
Copy link

Expected behaviour

The userscript attempts to check for duplicate images when the user selects a file for upload. I assume it's intended to warn the user if there's a hit.

Actual behaviour

https://i.imgur.com/qrfR6BY.png
When file is selected, displays error message: "IQDB: Internal Error 403 Forbidden" with a retry link that doesn't resolve the issue.

I'm seeing this behaviour on

Browser + Userscript Manager e.g. Tampermonkey on Google Chrome v80.
Tampermonkey on Waterfox G6.0.8(current)

Steps to reproduce

Just try to upload a picture in the upload form. I haven't tried it using URL uploading.
https://e621.net/iqdb_queries works. Queries to IQDB from other extensions work. The image is correctly checked when hitting submit and blocked if a duplicate is found, so there's nothing going really wrong.

@nuenuewei nuenuewei added the bug Something isn't working label Jan 28, 2024
@faucetlol
Copy link
Contributor

It's a very long-standing issue, I'm actually quite surprised this is the first report here on GitHub, or how nobody's ever took the time to fix it.

I took a look ages ago, I think the problem was something along the lines of re621 providing the IQDB endpoint with a local file path instead of uploading the file, which obviously won't work, resulting in an error.

It's worth noting that it functions perfectly fine when using URL uploading, which is generally recommended for many other reasons too.

@bitWolfy
Copy link
Member

bitWolfy commented Feb 8, 2024

This may or not be an issue because I never sat down and tried to figure out how to pass on the local file over to IQDB.
I wish I had more time to work on re621 these days. I do realize that this should be addressed at some point, but it's unlikely to happen soon.

@atomicBlaze21
Copy link

I wrote a fix, but there are some limitations due to the nature of querying with a file, since it requires using a POST request instead of a GET request.

I couldn't add a "Duplicates Found" link that linked to /iqdb_queries and passed the file like the URL search does, the dupes only show up on the upload page.

Likewise, I couldn't add any additional reverse image search links in risContainer with file uploads. Image query POST requests would all likely need an API key.

Finally, I couldn't figure out why the handleInput function doesn't fire on drag-and-drop. I tried adding the drop event to the listener alongside input and paste, but nothing happened on drag/drop.

Ultimately, those issues are minimal or beyond the scope of the weird 403 error, which has been resolved.

@nuenuewei
Copy link
Author

Considering that I was only expecting, at most, for the check to be disabled when posting a local upload so the error wouldn't show, even a partially working or roundabout way to get an actual dupe check done would be above and beyond. Thanks for your hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants