JBOPS/utility/plex_allow_sync.py
2017-09-18 15:50:00 -04:00

18 lines
401 B
Python

"""
Allow syncing for users
"""
import requests
from plexapi.server import PlexServer
PLEX_URL = 'http://localhost:32400'
PLEX_TOKEN = 'xxxx'
plex = PlexServer(PLEX_URL, PLEX_TOKEN)
USER_IGNORE = ['username']
for user in plex.myPlexAccount().users():
if user.title not in USER_IGNORE:
r = requests.put('http://plex.tv/api/friends/{}'.format(user.id), headers=headers, params=payload)