mirror of
https://github.com/Tafkas/fritzbox-munin.git
synced 2023-10-10 11:36:55 +00:00
fritzbox_helper: Allow login with username
This commit is contained in:
parent
77afcdad3a
commit
458c9e123c
@ -27,7 +27,7 @@ import requests
|
||||
from lxml import etree
|
||||
|
||||
|
||||
def get_session_id(server, password, port=80):
|
||||
def get_session_id(server, password, port=80, username=None):
|
||||
"""Obtains the session id after login into the Fritzbox.
|
||||
See https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/AVM_Technical_Note_-_Session_ID.pdf
|
||||
for deteils (in German).
|
||||
@ -62,6 +62,9 @@ def get_session_id(server, password, port=80):
|
||||
else:
|
||||
return session_id
|
||||
|
||||
if username is not None:
|
||||
params['username'] = username
|
||||
|
||||
headers = {"Accept": "text/html,application/xhtml+xml,application/xml",
|
||||
"Content-Type": "application/x-www-form-urlencoded"}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user