alfonsrv/impf-botpy

Code 400: Geburtsdatum ungueltig oder in der Zukunft

Closed this issue · 1 comments

Vorerst vielen Dank für dieses großartige Repo. Es hat mir bereits vor einigen Wochen zu einem Termin verholfen. Nun ist auch das letzte Mitglied der Familie an der Reihe...

Bei der aktuellen Version auf einer frischen Installation auf Windows mit Chrome 91 und Chromedriver 91 mit vollständiger Konfiguration schlägt bei mir auf mehreren Systemen python3 main.py --code mit folgender Meldung fehl. Das Geburtsdatum ist in der Config wie folgt angegeben: 19‎.0‎7‎.‎1996

Hat das sonst noch wer? Was könnte die Ursache sein?

C:\Users\Leon Thierschmidt>python3 Git\impf-botpy\main.py --code
2021-06-07 01:25:20,914 - [INFO] <__main__.main.py:117>  Starting up Impf Bot.py - github/@alfonsrv, 05/2021 (version 0.46)
Before a Vermittlungscode can be generated, you must specify your phone number, email and the location in `settings.py`

The bot is hard-coded to only request BioNTech + Moderna (18-60yo)
Should you request a vaccination for an older demographic or prefer another vaccine this method won't work for you.

Please note: This feature may break at any time – use it while you can!
If it breaks, please just fall back to using the browser instead.


Enter the zip code of the location you require a Vermittlungscode for: 73430
Requesting Vermittlungscode for: KIZ Ostalbkreis, 73430 Aalen
2021-06-07 01:25:27,409 - [INFO] <impf.browser.browser.py:169>  73430: Navigating to ImpfterminService
2021-06-07 01:25:30,422 - [INFO] <impf.browser.browser.py:182>  73430: Selected Bundesland: Baden-Württemberg
2021-06-07 01:25:30,680 - [INFO] <impf.browser.browser.py:190>  73430: Selected Impfzentrum: 73430 Aalen, KIZ Ostalbkreis
2021-06-07 01:25:44,858 - [INFO] <impf.api.api.py:181>  API: Attempting to get Vermittlungscode from server
2021-06-07 01:25:45,058 - [WARNING] <impf.api.api.py:59>  API: Endpoint returned Error: Geburtsdatum ungueltig oder in der Zukunft
2021-06-07 01:25:45,058 - [INFO] <impf.api.api.py:60>  API: Cookies probably expired – raising AdvancedSessionCache
2021-06-07 01:25:45,058 - [WARNING] <impf.api.decorators.py:133>  API: Underlying service layer indicating invalid session for <generate_vermittlungscode> – refreshing all cookies and retrying
2021-06-07 01:25:46,670 - [INFO] <impf.browser.browser.py:169>  73430: Navigating to ImpfterminService
2021-06-07 01:25:49,711 - [INFO] <impf.browser.browser.py:182>  73430: Selected Bundesland: Baden-Württemberg
2021-06-07 01:25:49,939 - [INFO] <impf.browser.browser.py:190>  73430: Selected Impfzentrum: 73430 Aalen, KIZ Ostalbkreis
2021-06-07 01:26:06,152 - [INFO] <impf.api.api.py:181>  API: Attempting to get Vermittlungscode from server
Traceback (most recent call last):
  File "C:\Users\Leon Thierschmidt\Git\impf-botpy\impf\decorators.py", line 131, in func
    x = f(self, *args, **kwargs)
  File "C:\Users\Leon Thierschmidt\Git\impf-botpy\impf\api.py", line 195, in generate_vermittlungscode
    r = self.xs.post(f'{self.host}/rest/smspin/anforderung', json=data)
  File "C:\Users\Leon Thierschmidt\Git\impf-botpy\impf\decorators.py", line 119, in api_response
    x = self._handle_error(response.status_code, response.json())
  File "C:\Users\Leon Thierschmidt\Git\impf-botpy\impf\api.py", line 61, in _handle_error
    raise AdvancedSessionCache(code, message)
impf.exceptions.AdvancedSessionCache: Cookies likely expired – [400] {'error': 'Geburtsdatum ungueltig oder in der Zukunft'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Leon Thierschmidt\Git\impf-botpy\main.py", line 118, in <module>
    if args.code: instant_code(); exit()
  File "C:\Users\Leon Thierschmidt\Git\impf-botpy\main.py", line 70, in instant_code
    token = api.generate_vermittlungscode()
  File "C:\Users\Leon Thierschmidt\Git\impf-botpy\impf\decorators.py", line 137, in func
    return next_gen(f)(self, *args, **kwargs)
  File "C:\Users\Leon Thierschmidt\Git\impf-botpy\impf\decorators.py", line 131, in func
    x = f(self, *args, **kwargs)
  File "C:\Users\Leon Thierschmidt\Git\impf-botpy\impf\api.py", line 195, in generate_vermittlungscode
    r = self.xs.post(f'{self.host}/rest/smspin/anforderung', json=data)
  File "C:\Users\Leon Thierschmidt\Git\impf-botpy\impf\decorators.py", line 110, in api_response
    response = f(self, *args, **kwargs)
  File "C:\Users\Leon Thierschmidt\Git\impf-botpy\impf\api.py", line 40, in post
    return self.session.post(*args, **kwargs)
  File "C:\Users\Leon Thierschmidt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\sessions.py", line 590, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "C:\Users\Leon Thierschmidt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\Leon Thierschmidt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\sessions.py", line 671, in send
    extract_cookies_to_jar(self.cookies, request, r.raw)
  File "C:\Users\Leon Thierschmidt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\cookies.py", line 132, in extract_cookies_to_jar
    jar.extract_cookies(res, req)
AttributeError: 'dict' object has no attribute 'extract_cookies'

Okay.... merkwürdig. Da wurden bei meiner Eingabe in der Config scheinbar unsichtbare Zeichen eingefügt. Es funktioniert, wenn ich das Datum aus der sample-config kopiere und die einzelnen Ziffern anpasse.