Open yuuuiv opened 5 months ago
I met the same problem.
Fixed in v0.4.2.
Regarding your question, I believe that both 'JSESSIONID' and ''`kc@i.sjtu.edu.cn' are involved in the authorization process.
I met the same problem in v0.4.2.
I met the same problem in v0.4.2.
It seems I solve it by setting validate_session=False again.
@lan-qing Could you please provide more information? By setting validate_session
to false,
you lose the auto login function when the session expires.
@lan-qing Could you please provide more information? By setting
validate_session
tofalse,
you lose the auto login function when the session expires.
Dear PhotonQuantum,
Thanks for your reply. I installed pysjtu
in a new python environment just now and met the same problem again. Here is the error message:
[Clang 13.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysjtu
>>> c = pysjtu.create_client(username="xxx", password="xxx")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/client/__init__.py", line 71, in create_client
sess = Session(*args, **kwargs)
File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/session.py", line 122, in __init__
self.loads({"username": username, "password": password})
File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/session.py", line 429, in loads
self.login(self._username, self._password)
File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/session.py", line 368, in login
result = self._secure_req(
File "xxx/lib/python3.9/site-packages/pysjtu/session.py", line 85, in _secure_req
return ref()
File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/session.py", line 264, in post
return self.request(
File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/session.py", line 161, in request
self.login(self._username, self._password)
File "xxx/miniforge3/lib/python3.9/site-packages/pysjtu/session.py", line 359, in login
uuid = re.findall(r"(?<=uuid=).*(?=\")", login_page_req.text)[0]
IndexError: list index out of range
>>> pysjtu.__version__
'0.4.2'
Is this sufficient to identify the problem? If anything more is helpful, I would be happy to provide it.
When I try to login, it seems like the uuid cannot be defined correctly. Login with username and password: Login with cookies: By the way, could you please tell me which one between JSESSIONID and kc@i.sjtu.edu.cn is the one that contains session info? As I'm a freshman, I might need your further help...tks