Chouffy / home_assistant_tgtg

TooGoodToGo items stock as sensor in Home Assistant
MIT License
68 stars 18 forks source link

(Captch?) Error during startup #28

Closed groenmarsmannetje closed 2 years ago

groenmarsmannetje commented 2 years ago

I am experiencing the following error during Home Assistant startup. Could it be that it is requesting a Captcha response now to prevent this kind of integration?

Logger: homeassistant.components.sensor
Source: custom_components/tgtg/sensor.py:69
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 10:28:27 (1 occurrences)
Last logged: 10:28:27

Error while setting up tgtg platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/tgtg/sensor.py", line 69, in setup_platform
    tgtgReply = tgtg_client.get_items()
  File "/usr/local/lib/python3.9/site-packages/tgtg/__init__.py", line 211, in get_items
    self.login()
  File "/usr/local/lib/python3.9/site-packages/tgtg/__init__.py", line 121, in login
    self._refresh_token()
  File "/usr/local/lib/python3.9/site-packages/tgtg/__init__.py", line 111, in _refresh_token
    raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMASz11yZGnomMBKgKkaqsXAAF4H05OUfi8_A==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'0f8d99b29500025d4e6d59b9f1758e231521a0c6e81bdcd5686e3e08f827e7de\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')
Chouffy commented 2 years ago

Hey @groenmarsmannetje , it seems that some people are also experiencing this ... I'll let you review the thread I'll close this issue here because there's nothing I can do unfortunately

peterampazzo commented 2 years ago

@maartenhendrix I experienced the same issue, for now the error is gone after I have generated fresh new tokens. Not sure if this helps.