Der-Henning / tgtg

Scanner for Too Good To Go Notifications
https://github.com/Der-Henning/tgtg/wiki
GNU General Public License v3.0
414 stars 69 forks source link

"Too many captcha Errors!" #370

Open silassession opened 1 year ago

silassession commented 1 year ago

When I try to open the scanner (v1.16.3) on MacOS I keep getting the same error message:

"Too many captcha Errors! Sleeping for 10 minutes..."

Is there any workaround to this?

Marcel-NL1963 commented 1 year ago

I had the same issue. I waited for a day and then it was working fine.

silassession commented 1 year ago

Thanks, it's working again today!

Zilverdael80 commented 1 year ago

I've had the same issue reported yesterday. Then, later at night, it seemed to work fine again and I received a box available message. Now, it's back down again, 403 errors

[edit] cuz i started wrong app version! 1.16.3 uses API V8

Marcel-NL1963 commented 1 year ago

I saw this in a previous issue. Update: TGTG changed their API. A small update https://github.com/Der-Henning/tgtg/commit/12dbc576c40b593a1229a73515fbcd62cf037782 should do the trick. I will create a new release as soon as possible.

Zilverdael80 commented 1 year ago

omg, I messed it up myself ... After PC reboot i started 1.16.2 instead of 1.16.3 ... So ignore my previous reaction!

[Updated] Cheered too soon. API V8 has same issue

image

Marcel-NL1963 commented 1 year ago

Did you already try the update? https://github.com/Der-Henning/tgtg/commit/12dbc576c40b593a1229a73515fbcd62cf037782 should do the trick.

Zilverdael80 commented 1 year ago

Did you already try the update? 12dbc57 should do the trick.

Yep, its on the 1.16.3 build right? Pointing to API V8 In the screenshot it shows the post /item/v8/ so i assume i'm on the correct API version.

Marcel-NL1963 commented 1 year ago

Yup, you're right. Sadly my knowledge stops here :( Found this in the FAQ: https://github.com/Der-Henning/tgtg/wiki/FAQ#1-i-am-getting-error-403-all-the-time

consdu commented 1 year ago

Still getting the same issue here with the last version v1.16.3 on linux, any fixes coming ? Screenshot 2023-06-21 at 19 52 18

haver007 commented 1 year ago

Also changes on the login? I'm on 1.17.0 RPi4 via Docker Maybe also an change on Cookies?

app_1  | 2023-06-23 08:22:37 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByEmail HTTP/1.1" 403 None
app_1  | 2023-06-23 08:22:37 DEBUG    Captcha Error 403!
Der-Henning commented 1 year ago

Hi everyone. I am very sorry, but there is no general solution to this problem at the moment. The error is caused by reaching the rate limit for API requests. This can be caused by running multiple scanners in parallel from the same network. This can be scanners in your local network but also in the network of your ISP, as many ISP only provide one IP address to many users. You can only try to wait or switch the network. E.g. use a proxy or try to deploy the scanner on a remote machine or virtual server in a different network.

floriegl commented 1 year ago

I have the same issue. I switched to a new account with a new e-mail and at the same time a new IP but after less than 3 hours I only get 429 again. I have a sleep time of 3 minutes but 32 item IDs to monitor (not in my favorites as I use a burner account). I am going to look into optimizing the request of items in the same area (all of my items are in a radius of about 5 km) by using tgtg_client.get_items instead of 32 calls to get_item and reporting back here. My plans are ether an env var which lets the user set the used tgtg as a burner and automatically add all ITEM_IDS to the favorites (and update them on startup) or allow setting a location for tgtg_client.get_items and then filtering the results by the ITEM_IDS.

Der-Henning commented 1 year ago

Hi @floriegl. I really don't recommend using the item_ids feature. This creates too many requests which will trigger the rate limit very fast as you noticed. The option is only included in the code as a legacy feature from the early days when rate limiting didn't exist. You should always use favorites to manage the items you want to scan. You can also manage the favorites using the scanner as described here. So you don't have to log in to the TGTG app with the account you are using for the scanner.

floriegl commented 1 year ago

Yeah, but I am running it as a docker container where I don't have access to the scanner directly and getting Telegram notifications. I was thinking about adding a way to manage the items using BotCommand and maybe saving them in a volume or something the takeover into a new account or something. Just sharing the https://share.toogoodtogo.com/item/ link from the app to the bot would be great too. Can I create a separate issue and pull request for that?

Der-Henning commented 1 year ago

Yes, feel free to create a PR. But you can always manage your TGTG account with the provided executables. Or you can simply use the script in the running container.

docker exec <tgtg-container-name> python main.py -h
docker exec <tgtg-container-name> python main.py -F

Or ssh directly into the container and run the commands.

It already allows you to export the favorites in a way you can directly import them into a different account.

floriegl commented 1 year ago

I created the following MR https://github.com/Der-Henning/tgtg/pull/386