MaxWinterstein / toogoodtogo-ha-mqtt-bridge

33 stars 8 forks source link

IP blocked? Captcha active #147

Closed HanBarn closed 1 year ago

HanBarn commented 1 year ago

For weeks this integration is running fine. Today it suddenly stopped working. The polling interval is 5 minutes most of the time and only active during daytime.

The log shows that Captcha is active. The URL can be opened manually and the puzzle can be solved, but the errors keep on going.

part of the log:

[14:05:29] INFO: Strating Bridge... 2023-06-27 14:05:31 [INFO] Connecting mqtt 2023-06-27 14:05:31 [INFO] Starting loop 2023-06-27 14:05:31 [INFO] Checking latest tgtg appstore version 2023-06-27 14:05:31 [INFO] Loaded tokens form tokenfile. Logging in with tokens. Exception in thread Thread-3 (fetch_loop): Traceback (most recent call last): File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/local/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/app/toogoodtogo_ha_mqtt_bridge/main.py", line 324, in fetch_loop tgtg_client.login() File "/usr/local/lib/python3.10/site-packages/tgtg/init.py", line 139, in login self._refresh_token() File "/usr/local/lib/python3.10/site-packages/toogoodtogo_ha_mqtt_bridge-2.2.3-py3.10.egg/toogoodtogo_ha_mqtt_bridge/mytgtgclient.py", line 61, in _refresh_token raise TgtgAPIError(response.status_code, response.content) tgtg.exceptions.TgtgAPIError: (403, b'{"url":"https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAeXZO5v-5_9wAVlrTzA==&cid=1hWJShvP76y69yfOy4fZr1qaDBBx2ZZsq3DyJSBL2xFVqXvbln31Uw_q-vwMjoRAoLQicWmkmzOwI8BTgi-2pGai8yeuBB_1HtHWdvU_3pyoX7BBY6DoV2SKxK4TqOfZ&referer=https%3A%2F%2Fapptoogoodtogo.com%2Fapi%2Fauth%2Fv3%2Ftoken%2Frefresh&hash=1D42C2CA6131C526E09F294FE96F94&t=fe&s=35558&e=4ed3798729d67aaf74c6cce15f7e8855d445ba4b17b81e51633b3e3764910e3e"}') 2023-06-27 14:20:30 [ERROR] Watchdog handler fired! No pull in the last 14.983333333333333 minutes! NoneType: None s6-svscanctl: fatal: unable to control /var/run/s6/services: No such file or directory [14:20:30] INFO: Strating Bridge... <etc…….>

HanBarn commented 1 year ago

Might be related to this issue. https://github.com/Der-Henning/tgtg/issues/370#issuecomment-1604628725

HanBarn commented 1 year ago

Stopped the integration yesterday. Started it again this morning. Polling interval 5 minutes. It seems to be working again. So the issue might be related to too many request in a short time i.e. polling at a 1 minute interval. Will monitor the situation.

update! During the day no problems occurred. So it looks like TGTG has tightened the amount of polls per period/day. Not so long ago an interval of 1 minute could be active for the whole day. Switched back to 5 minutes now.