CONFIG and SSL
This commit is contained in:
parent
faf959fa4a
commit
8d7f0fc11b
@ -18,13 +18,15 @@ optional arguments:
|
||||
|
||||
|
||||
import requests
|
||||
from plexapi.server import PlexServer
|
||||
from plexapi.server import PlexServer, CONFIG
|
||||
import argparse
|
||||
import random
|
||||
|
||||
# Edit
|
||||
PLEX_URL = 'http://localhost:32400'
|
||||
PLEX_TOKEN = 'xxxxxx'
|
||||
PLEX_URL = ''
|
||||
PLEX_TOKEN = ''
|
||||
PLEX_URL = CONFIG.data['auth'].get('server_baseurl', PLEX_URL)
|
||||
PLEX_TOKEN = CONFIG.data['auth'].get('server_token', PLEX_TOKEN)
|
||||
|
||||
LIBRARY_EXCLUDE = ['Audio Books', 'Podcasts', 'Soundtracks']
|
||||
DEFAULT_NAME = 'Popular Music Playlist'
|
||||
@ -32,7 +34,17 @@ DEFAULT_NAME = 'Popular Music Playlist'
|
||||
# /Edit
|
||||
|
||||
sess = requests.Session()
|
||||
sess.verify = False
|
||||
# Ignore verifying the SSL certificate
|
||||
sess.verify = False # '/path/to/certfile'
|
||||
# If verify is set to a path to a directory,
|
||||
# the directory must have been processed using the c_rehash utility supplied
|
||||
# with OpenSSL.
|
||||
if sess.verify is False:
|
||||
# Disable the warning that the request is insecure, we know that...
|
||||
import urllib3
|
||||
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
plex = PlexServer(PLEX_URL, PLEX_TOKEN, session=sess)
|
||||
|
||||
music_sections = [x.title for x in plex.library.sections() if x.type == 'artist' and x.title not in LIBRARY_EXCLUDE]
|
||||
|
Loading…
Reference in New Issue
Block a user