From 442a623b25db2398eeef918e6173d9833767d2cb Mon Sep 17 00:00:00 2001 From: fazer666 Date: Sun, 19 Feb 2023 16:48:44 +0100 Subject: [PATCH] Feb 2023 : SUEZ changed token name and encoding. Changed regex accordingly --- pysuez/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pysuez/client.py b/pysuez/client.py index 9273e69..a71b8ba 100644 --- a/pysuez/client.py +++ b/pysuez/client.py @@ -55,7 +55,8 @@ def _get_token(self): headers['Cookie'] += "; " headers['Cookie'] += key + "=" + response.cookies[key] - phrase = re.compile('_csrf_token" value="(.*)"/>') + # Feb 2023 : SUEZ changed token name and encoding. Changed regex accordingly + phrase = re.compile('.u0022csrfToken.u0022.u003A.u0022(.*).u0022,') result = phrase.search(response.content.decode('utf-8')) self._token = result.group(1) self._headers = headers