google-this icon indicating copy to clipboard operation
google-this copied to clipboard

v1.4.0 searching for images returns this error. it was working before

Open aymenitc opened this issue 2 years ago • 5 comments

Steps to reproduce

hello, I just test this simple code and it returns error:

const images = await googlethis.image('The Wolf Among Us', { safe: false });
console.log(images); 

Failure Logs

TypeError: Cannot read properties of null (reading '1')
at Object.image in googlethis/lib/core/main.js

Expected behavior

it was working before as it return json results of search images

Current behavior

it produces this error

Version

Default

Anything else?

No response

Checklist

  • [X] I am running the latest version.
  • [X] I checked the documentation and found no answer.
  • [X] I have searched the existing issues and made sure this is not a duplicate.
  • [X] I have provided sufficient information.

aymenitc avatar Sep 24 '22 01:09 aymenitc

Same issue here.

wildanrfq avatar Sep 26 '22 09:09 wildanrfq

Hey everyone, sorry for the delay ~ Seems like the structure of the response changed, I'll try to reproduce & fix this later today. Thanks!

Edit: Or maybe a few parameters are missing in the request? In the previous version we would always include _reqid and f.sid in the request, but now those are always set to -0 (I thought they weren't important). I'll revert that change and publish a new version to NPM.

Edit 2: Done, please try v1.4.1 and let me know if it still errors out.

LuanRT avatar Sep 26 '22 20:09 LuanRT

I got this error:

Uncaught SearchError: Unknown error
    at Object.image (\googlethis\lib\core\main.js:210:11)

The code is just (async () => { await google.image("google") })().

wildanrfq avatar Oct 02 '22 16:10 wildanrfq

I got this error:

Uncaught SearchError: Unknown error
    at Object.image (\googlethis\lib\core\main.js:210:11)

The code is just (async () => { await google.image("google") })().

Update to v1.4.3 and let me know if it works, it should support Google's latest response structure.

LuanRT avatar Oct 03 '22 06:10 LuanRT

It's working now! Thank you so much.

wildanrfq avatar Oct 03 '22 15:10 wildanrfq

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.

github-actions[bot] avatar Dec 03 '22 02:12 github-actions[bot]