mirror of
https://github.com/Tafkas/fritzbox-munin.git
synced 2023-10-10 11:36:55 +00:00
fritzbox_helper: Allow to pass additional form fields to get_xhr_content
This commit is contained in:
parent
0ac988bb45
commit
90143fa422
@ -122,7 +122,7 @@ def get_page_content(server, session_id, page, port=0, tls=False):
|
||||
return r.content
|
||||
|
||||
|
||||
def get_xhr_content(server, session_id, page=None, port=0, tls=False):
|
||||
def get_xhr_content(server, session_id, page=None, port=0, tls=False, data={}):
|
||||
"""Fetches the xhr content from the Fritzbox and returns its content
|
||||
|
||||
:param server: the ip address of the Fritzbox
|
||||
@ -137,12 +137,13 @@ def get_xhr_content(server, session_id, page=None, port=0, tls=False):
|
||||
"Content-Type": "application/x-www-form-urlencoded"}
|
||||
|
||||
url = '{}/data.lua'.format(base_uri)
|
||||
data = {"xhr": 1,
|
||||
data.update({
|
||||
"xhr": 1,
|
||||
"sid": session_id,
|
||||
"lang": "en",
|
||||
"xhrId": "all",
|
||||
"no_sidrenew": ""
|
||||
}
|
||||
})
|
||||
|
||||
if page is not None:
|
||||
data["page"] = page
|
||||
|
Loading…
x
Reference in New Issue
Block a user