mirror of
https://github.com/Tafkas/fritzbox-munin.git
synced 2023-10-10 11:36:55 +00:00
fritzbox_helper: Make page parameter in get_xhr_content optional
This commit is contained in:
parent
ee31101a09
commit
0ac988bb45
@ -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, port=0, tls=False):
|
def get_xhr_content(server, session_id, page=None, port=0, tls=False):
|
||||||
"""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
|
||||||
@ -140,10 +140,13 @@ def get_xhr_content(server, session_id, page, port=0, tls=False):
|
|||||||
data = {"xhr": 1,
|
data = {"xhr": 1,
|
||||||
"sid": session_id,
|
"sid": session_id,
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"page": page,
|
|
||||||
"xhrId": "all",
|
"xhrId": "all",
|
||||||
"no_sidrenew": ""
|
"no_sidrenew": ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if page is not None:
|
||||||
|
data["page"] = page
|
||||||
|
|
||||||
try:
|
try:
|
||||||
r = requests.post(url, data=data, headers=headers)
|
r = requests.post(url, data=data, headers=headers)
|
||||||
except (requests.exceptions.HTTPError,
|
except (requests.exceptions.HTTPError,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user