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
|
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
|
"""Fetches the xhr content from the Fritzbox and returns its content
|
||||||
|
|
||||||
:param server: the ip address of the Fritzbox
|
: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"}
|
"Content-Type": "application/x-www-form-urlencoded"}
|
||||||
|
|
||||||
url = '{}/data.lua'.format(base_uri)
|
url = '{}/data.lua'.format(base_uri)
|
||||||
data = {"xhr": 1,
|
data.update({
|
||||||
|
"xhr": 1,
|
||||||
"sid": session_id,
|
"sid": session_id,
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"xhrId": "all",
|
"xhrId": "all",
|
||||||
"no_sidrenew": ""
|
"no_sidrenew": ""
|
||||||
}
|
})
|
||||||
|
|
||||||
if page is not None:
|
if page is not None:
|
||||||
data["page"] = page
|
data["page"] = page
|
||||||
|
Loading…
x
Reference in New Issue
Block a user