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

LensError: Could not parse response: TypeError: Cannot read properties of null (reading '0') #11

Open
TheRealStingo opened this issue May 2, 2024 · 16 comments

Comments

@TheRealStingo
Copy link

TheRealStingo commented May 2, 2024

Sometimes when you i do requests . it doesnt retun the JSON object but instead it returns and error and some html body ,

it works like 3-4 times and then the issue appears , its like a russian roullete , sometimes i get it 3 times in a row and sometimes i dont get it in like 200 tries ( using the same picture over and over again )
image

@dimdenGD
Copy link
Owner

dimdenGD commented May 2, 2024

In order for me to debug this, you need to provide full body text

@TheRealStingo
Copy link
Author

In order for me to debug this, you need to provide full body text

error_log.txt
here

@dimdenGD
Copy link
Owner

dimdenGD commented May 3, 2024

I couldn't reproduce your error with provided body. Make sure you're using latest version of the library

@TheRealStingo
Copy link
Author

Make sure you're using latest version of the library

i already did , also a small question . what about rate limit . is there a way to add proxy support ?

@dimdenGD
Copy link
Owner

dimdenGD commented May 3, 2024

Proxies are already supported, check readme

@TheRealStingo
Copy link
Author

image
im still getting the same error just by running the example in the readme . could you please watch this video to understand more
https://www.veed.io/view/ad9c1b4a-2c73-4373-9fdf-47b6647cb9bb?panel=share

@Arikips
Copy link

Arikips commented May 14, 2024

Same for me. I think it's because of CAPTCHa or VPN

@andreamagazzini
Copy link

Same for me. I think it's because of CAPTCHa or VPN

Did you find any solution?

@osmarks
Copy link

osmarks commented May 17, 2024

This happens inconsistently to me. Here's the body: https://osmarks.net/stuff/ocr_goog.txt

@Arikips
Copy link

Arikips commented May 17, 2024

Same for me. I think it's because of CAPTCHa or VPN

Did you find any solution?

This happens inconsistently to me. Here's the body: https://osmarks.net/stuff/ocr_goog.txt

Yes I think I did.
It seems like the problem is somewhere in the lib itself. I tried owocr(https://github.com/AuroraWright/owocr) and it works without any troubles. Also I have written a script of my own based off it where I added extra image preprocessing to speed up the scanning, so extracting big text from my 4k monitor takes about 1.2 seconds. I think I will upload it to my github and send you guys the link.

@dimdenGD
Copy link
Owner

This happens inconsistently to me. Here's the body: https://osmarks.net/stuff/ocr_goog.txt

I tried running the script on your body and couldn't reproduce the issue.

@Arikips
Copy link

Arikips commented May 17, 2024

Same for me. I think it's because of CAPTCHa or VPN

Did you find any solution?

This happens inconsistently to me. Here's the body: https://osmarks.net/stuff/ocr_goog.txt

I uploaded my script, you can give it a try if you want

@andreamagazzini
Copy link

I uploaded my script, you can give it a try if you want

@Arikips I only see the solution in python, any idea about how to fix it in javascript?

@dimdenGD
Copy link
Owner

You need to provide body of errored request for any fixes to be done. I checked their code and it does exact same thing as this library except it should be even more error prone because it doesn't account for second data structure

@andreamagazzini
Copy link

You need to provide body of errored request for any fixes to be done. I checked their code and it does exact same thing as this library except it should be even more error prone because it doesn't account for second data structure

I was also checking and I noticed it does the same.
I tried also to call the post from scratch but probably I miss something as I always get as response a page where to download google lens but no AF_initCallback data, which are the parameters that are needed in order for the post to be successful?

@dimdenGD
Copy link
Owner

I dont know specific parameters, try using same ones as used in code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants