diff --git a/utility/plex_api_invite.py b/utility/plex_api_invite.py index 29ab3e2..c9d8864 100644 --- a/utility/plex_api_invite.py +++ b/utility/plex_api_invite.py @@ -41,9 +41,12 @@ import requests PLEX_URL = '' PLEX_TOKEN = '' -PLEX_URL = CONFIG.data['auth'].get('server_baseurl', PLEX_URL) -PLEX_TOKEN = CONFIG.data['auth'].get('server_token', PLEX_TOKEN) +if not PLEX_URL: + PLEX_URL = CONFIG.data['auth'].get('server_baseurl', '') + +if not PLEX_TOKEN: + PLEX_TOKEN = CONFIG.data['auth'].get('server_token', '') sess = requests.Session() # Ignore verifying the SSL certificate diff --git a/utility/plex_api_share.py b/utility/plex_api_share.py index 099e41a..1838bb3 100644 --- a/utility/plex_api_share.py +++ b/utility/plex_api_share.py @@ -100,8 +100,12 @@ import json PLEX_URL = '' PLEX_TOKEN = '' -PLEX_URL = CONFIG.data['auth'].get('server_baseurl', PLEX_URL) -PLEX_TOKEN = CONFIG.data['auth'].get('server_token', PLEX_TOKEN) + +if not PLEX_URL: + PLEX_URL = CONFIG.data['auth'].get('server_baseurl', '') + +if not PLEX_TOKEN: + PLEX_TOKEN = CONFIG.data['auth'].get('server_token', '') DEFAULT_MESSAGE = "Stream is being killed by admin." diff --git a/utility/sync_watch_status.py b/utility/sync_watch_status.py index 2890332..8d6607b 100644 --- a/utility/sync_watch_status.py +++ b/utility/sync_watch_status.py @@ -58,8 +58,12 @@ from plexapi.server import PlexServer, CONFIG # Using CONFIG file PLEX_URL = '' PLEX_TOKEN = '' -PLEX_URL = CONFIG.data['auth'].get('server_baseurl', PLEX_URL) -PLEX_TOKEN = CONFIG.data['auth'].get('server_token', PLEX_TOKEN) + +if not PLEX_URL: + PLEX_URL = CONFIG.data['auth'].get('server_baseurl', '') + +if not PLEX_TOKEN: + PLEX_TOKEN = CONFIG.data['auth'].get('server_token', '') sess = requests.Session()