Open ghhausi opened 4 days ago
I found a solution by replacing the code block from client.py (line 53):
result = self.session.post(
action,
data={
"username": self.username,
"password": self.password,
},
allow_redirects=False,
)
... with the following code. It seems that the authentication was changed. It now requires a two step approach (as found in this issue).
result = self.session.post(
action,
data={
"username": self.username,
"login": ""
},
allow_redirects=False,
)
tree = html.fromstring(result.content)
action = tree.xpath("(//form/@action)")[0]
result = self.session.post(
action,
data={
"username": self.username,
"password": self.password,
},
allow_redirects=False,
)
I can confirm: It works! I have a different line number but anyway: Replacing the the section in the beginning of "_login" as described above solves the issue. Thanks for your input!
Thank you very much, I also tried to resolve this issue but did not have enough time. Now it works again !!!
Thanks!
Thank you, created a PR to get it fixed.
Login does not work as expected: "Vienna_smartmeter.py" #74: _result = self.session.post( action, data={ "username": self.username, "password": self.password, }, allowredirects=True, ) gets a "200 OK" instead of "302 found" and a Location (with "code=") with the "200 OK" there is no "Location" and therefore no "code=" and Login fails ....
In the post-request there is "&client_data=...." which is shorter in the python function compared to the browser/web-form
Any ideas ?? regards Gerhard