mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 04:49:36 -07:00
Fix parsing request responst message
This commit is contained in:
parent
70c0f912e2
commit
0272c35047
1 changed files with 11 additions and 11 deletions
|
@ -295,15 +295,15 @@ def server_message(response, return_msg=False):
|
|||
try:
|
||||
soup = BeautifulSoup(response.content, "html5lib")
|
||||
except Exception:
|
||||
pass
|
||||
soup = None
|
||||
|
||||
if soup:
|
||||
# Find body and cleanup common tags to grab content, which probably
|
||||
# contains the message.
|
||||
message = soup.find("body")
|
||||
elements = ("header", "script", "footer", "nav", "input", "textarea")
|
||||
|
||||
for element in elements:
|
||||
|
||||
for tag in soup.find_all(element):
|
||||
tag.replaceWith("")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue