mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
Merge pull request #260 from TrueTechy/public_info_check
Added better error handling to public info check
This commit is contained in:
commit
38e151dc9a
1 changed files with 6 additions and 1 deletions
|
@ -430,7 +430,12 @@ class API(object):
|
||||||
|
|
||||||
def get_public_info(self, server_address):
|
def get_public_info(self, server_address):
|
||||||
response = self.send_request(server_address, "system/info/public")
|
response = self.send_request(server_address, "system/info/public")
|
||||||
return response.json() if response.status_code == 200 else {}
|
try:
|
||||||
|
return response.json() if response.status_code == 200 else {}
|
||||||
|
except JSONDecodeError as e:
|
||||||
|
LOG.error("Failed to get server public info. JSON error: %s" % e)
|
||||||
|
LOG.error(response.content)
|
||||||
|
return {}
|
||||||
|
|
||||||
def check_redirect(self, server_address):
|
def check_redirect(self, server_address):
|
||||||
''' Checks if the server is redirecting traffic to a new URL and
|
''' Checks if the server is redirecting traffic to a new URL and
|
||||||
|
|
Loading…
Reference in a new issue