bain3 / pronotepy

A python API wrapper for pronote
MIT License
189 stars 55 forks source link

Impossible de se connecter avec la version 2.13.1 : Connection failure #306

Closed ioull closed 2 months ago

ioull commented 2 months ago

Voici mon code de test qui fonctionne avec la version 2.13.0 :

import pronotepy
from pronotepy.ent import occitanie_toulouse_edu

client = pronotepy.ParentClient('https://0312744p.index-education.net/pronote/parent.html',
                          username='xxxxxxx',
                          password='xxxxxxx',
                          ent=occitanie_toulouse_edu)

if client.logged_in: # check if client successfully logged in
    # get the all the periods (may return multiple types like trimesters and semesters but it doesn't really matter
    # the api will get it anyway)
    periods = client.periods

    for period in periods:
        for grade in period.grades:  # iterate over all the grades
            print(f'{grade.grade}/{grade.out_of}')  # print out the grade in this style: 20/20

Apres upgrade en 2.13.1 (commande pip install pronotepy==2.13.1) j'ai l'erreur suivante:

Traceback (most recent call last):                                                                                                         
  File "/services/pronote2rest/dev/test.py", line 4, in <module>                                                                           
    client = pronotepy.ParentClient('https://0312744p.index-education.net/pronote/parent.html',                                            
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                            
  File "/services/pronote2rest/dev/myvenv2/lib/python3.11/site-packages/pronotepy/clients.py", line 795, in __init__                       
    super().__init__(pronote_url, username, password, ent, mode, uuid)                                                                     
  File "/services/pronote2rest/dev/myvenv2/lib/python3.11/site-packages/pronotepy/clients.py", line 433, in __init__                       
    super().__init__(pronote_url, username, password, ent, mode, uuid)                                                                     
  File "/services/pronote2rest/dev/myvenv2/lib/python3.11/site-packages/pronotepy/clients.py", line 83, in __init__                        
    cookies = ent(username, password, pronote_url=pronote_url)                                                                             
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                             
  File "/services/pronote2rest/dev/myvenv2/lib/python3.11/site-packages/pronotepy/ent/generic_func.py", line 134, in _cas_edu              
    raise ENTLoginError("Connection failure")                                                                                              
pronotepy.exceptions.ENTLoginError: Connection failure                                                                                     

Si je revert en 2.13.0 ca se remet à fonctionner

bain3 commented 2 months ago

Hi, please try on the latest version.

pip install -U git+https://github.com/bain3/pronotepy

Also, consider using the QR code method to log in. It should be more stable.

ioull commented 2 months ago

Perfect ! it works ! thanks !