mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-05-30 12:56:13 +00:00
Follow redirects when connecting to server
This commit is contained in:
parent
69bb8bca04
commit
0647447c3c
2 changed files with 24 additions and 13 deletions
|
@ -412,7 +412,7 @@ class API(object):
|
|||
|
||||
return {}
|
||||
except Exception as e: # Find exceptions for likely cases i.e, server timeout, etc
|
||||
LOG.error(e)
|
||||
LOG.error(e)
|
||||
|
||||
return {}
|
||||
|
||||
|
@ -430,4 +430,13 @@ class API(object):
|
|||
|
||||
def get_public_info(self, server_address):
|
||||
response = self.send_request(server_address, "system/info/public")
|
||||
return response.json() if response.status_code == 200 else {}
|
||||
return response.json() if response.status_code == 200 else {}
|
||||
|
||||
def check_redirect(self, server_address):
|
||||
''' Checks if the server is redirecting traffic to a new URL and
|
||||
returns the URL the server prefers to use
|
||||
'''
|
||||
response = self.send_request(server_address, "system/info/public")
|
||||
url = response.url.replace('/system/info/public', '')
|
||||
return url
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue