MCPcopy Index your code
hub / github.com/RickDB/PlexMALSync / plex_authenticate

Function plex_authenticate

PlexMALSync.py:31–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30
31def plex_authenticate():
32 method = plex_settings['authentication_method'].lower()
33 # Direct connection
34 if method == 'direct':
35 base_url = plex_settings['base_url']
36 token = plex_settings['token']
37 plex = PlexServer(base_url, token)
38 # Myplex connection
39 elif method == 'myplex':
40 plex_server = plex_settings['server']
41 plex_user = plex_settings['myplex_user']
42 plex_password = plex_settings['myplex_password']
43 account = MyPlexAccount(plex_user, plex_password)
44 plex = account.resource(plex_server).connect()
45 else:
46 logger.critical(
47 '[PLEX] Failed to authenticate due to invalid settings or authentication info, exiting...')
48 sys.exit()
49 return plex
50
51
52def mal_authenticate():

Callers 1

PlexMALSync.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected