bain3 / pronotepy

A python API wrapper for pronote
MIT License
182 stars 51 forks source link

Erorr while doing Keep alive #174

Open bdbogjoe opened 1 year ago

bdbogjoe commented 1 year ago

i'm trying to use keep alive but i have this error :

I'm running this is dedicated thread : client.keep_alive().alive()

but i have this error after delay of 300s while doing real keep alive self._client.post("Presence", 7)

2022-09-28 22:39:13,102 - pronotepy.pronoteAPI - INFO - Have you tried turning it off and on again? ERROR: 13 | La page a expiré ! (6)
Traceback (most recent call last):
  File "/home/eric/domotique/pronotepy/venv/lib/python3.10/site-packages/pronotepy/clients.py", line 765, in post
    return self.communication.post(function_name, post_data)
  File "/home/eric/domotique/pronotepy/venv/lib/python3.10/site-packages/pronotepy/pronoteAPI.py", line 187, in post

What is wrong in my code ?

bain3 commented 1 year ago

Hi, sorry for the late reply.

What is wrong with my code?

Probably nothing. It looks like the page expired even though we tried to keep it alive with presence packets. Could you check how often your browser does a request to pronote when idle? Your instance could be set up differently with shorter delays...

bain3 commented 1 year ago

Looking at the current demo website it does send something a bit different: appelpolling requests that look like an attempt at notifications maybe? I don't see any Presence requests anymore. Since there is always a pending request, it might have replaced the original system.