LuanRT / google-this

A simple yet powerful module to retrieve organic search results and much more from Google.
https://www.npmjs.com/package/googlethis
MIT License
320 stars 77 forks source link

Reverse image search: Direct image upload #31

Closed Randomblock1 closed 1 year ago

Randomblock1 commented 2 years ago

Describe your suggestion

Google offers an image upload option in addition to a URL. It's pretty simple to do this with CURL: curl -F 'encoded_image=@image.jpg' https://images.google.com/searchbyimage/upload and it responds with:

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="https://www.google.com/search?tbs=sbi:random_string_you_get_the_idea">here</A>.
</BODY></HTML>

It shouldn't be too hard to add this, it should check if it's being passed a string (url) or buffer (image) and act accordingly.

Other details

No response

Checklist

Emilundpixeln commented 1 year ago

Currently, direct image upload doesn't support pagination, which would be nice to have.

I have an idea how to fix this using the fingerprint that gets returned (redirected to) by searchbyimage/upload. https://github.com/Emilundpixeln/google-this-ris-preview-img/commit/17ee8911d6999ce797b999b8ba71d4a2011a6711

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.