CJNE / pyporscheconnectapi

Python client library for Porsche Connect API
MIT License
47 stars 12 forks source link

KeyError: 'message' #29

Closed sracing closed 5 months ago

sracing commented 1 year ago

Worked like charm for many months. Then recently the new authorisation process came. I updated pyporscheconnectapi. Worked again for 3 days and then ....

Since a few days, I am getting errors while running my script with pyporscheconnectapi even in the latest version (0.1.3).

Now as a reference, using both of your example scripts in the 'Library usage' section, I am getting the following error:

Traceback (most recent call last): File "C:\Users\plane\AppData\Roaming\JetBrains\PyCharmCE2022.3\scratches\scratch_3.py", line 23, in loop.run_until_complete(vehicles()) File "C:\Program Files\Python\Python_311\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\plane\AppData\Roaming\JetBrains\PyCharmCE2022.3\scratches\scratch_3.py", line 13, in vehicles vehicles = await client.getVehicles() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\plane\PycharmProjects\PyPorsche\venv\Lib\site-packages\pyporscheconnectapi\client.py", line 448, in getVehicles vehicles = await self._connection.get( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\plane\PycharmProjects\PyPorsche\venv\Lib\site-packages\pyporscheconnectapi\connection.py", line 233, in get headers = await self._createhead(application) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\plane\PycharmProjects\PyPorsche\venv\Lib\site-packages\pyporscheconnectapi\connection.py", line 287, in _createhead token = await self._requestToken( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\plane\PycharmProjects\PyPorsche\venv\Lib\site-packages\pyporscheconnectapi\connection.py", line 202, in _requestToken await self._login() File "C:\Users\plane\PycharmProjects\PyPorsche\venv\Lib\site-packages\pyporscheconnectapi\connection.py", line 149, in _login raise WrongCredentials(message['message'])


KeyError: 'message'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001AA684A0C50>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x000001AA6845B850>, 185288.109)]']
connector: <aiohttp.connector.TCPConnector object at 0x000001AA684A0CD0>

Am I the only one?
Any idea what I need to change?
TimoD87 commented 1 year ago

I have the same problem, it comes from, that the Porsche API sometimes now wants a cpatcha to get resolved for first login :-( it depends on the IP Adress it looks like they now have a black list,...

After some time not trying to login it works again, but than (after relogin) maybe due to missing token refresh I'll be banned again,..

Any updates on token refresh?

Greetings

image

TimoD87 commented 1 year ago

I got it back working! The fix is:

If you get the Mail from Porsche: porsche-id-notifications@porsche.com

You must only click: reactivate account here! Do not reset you Password on the upcoming homepage, because if you do your IP is again deleted from the whitelist and it is not working. After clicking here, I got it back working.

Kind regards

fredriklj commented 5 months ago

I am closing this issue as the APIs we relied on have been retired. C.f #46