update getting url and token variables

This commit is contained in:
Blacktwin 2018-04-10 13:34:28 -04:00
parent 3ecfd066bd
commit 54e1e4a8fa
3 changed files with 4 additions and 28 deletions

View File

@ -1,9 +0,0 @@
# Specify your details to this file and most of the scripts will get it.
[plex]
url = http://localhost:32400
token = xxxx
[tautulli]
url = http://localhost:8181/
api = xxxx

View File

@ -1,10 +0,0 @@
#---------------------------------------------------------
# Potential requirements.
# pip install -r requirements.txt
#---------------------------------------------------------
requests
plexapi
configparser
matplotlib
numpy
basemap

View File

@ -57,17 +57,12 @@ from plexapi.server import PlexServer
PLEX_FALLBACK_URL = 'http://127.0.0.1:32400'
PLEX_FALLBACK_TOKEN = ''
PLEX_URL = os.getenv('PLEX_URL', PLEX_FALLBACK_URL)
PLEX_TOKEN = os.getenv('PLEX_TOKEN', PLEX_FALLBACK_TOKEN)
PLEX_OVERRIDE_URL = ''
PLEX_OVERRIDE_TOKEN = ''
PLEX_URL = PLEX_OVERRIDE_URL or os.getenv('PLEX_URL', PLEX_FALLBACK_URL)
if PLEX_OVERRIDE_URL:
PLEX_URL = PLEX_OVERRIDE_URL
if PLEX_OVERRIDE_TOKEN:
PLEX_TOKEN = PLEX_OVERRIDE_TOKEN
PLEX_FALLBACK_TOKEN = ''
PLEX_OVERRIDE_TOKEN = ''
PLEX_TOKEN = PLEX_OVERRIDE_URL or os.getenv('PLEX_TOKEN', PLEX_FALLBACK_TOKEN)
sess = requests.Session()