Update plex_allow_sync.py
This commit is contained in:
@ -12,6 +12,9 @@ plex = PlexServer(PLEX_URL, PLEX_TOKEN)
|
|||||||
|
|
||||||
USER_IGNORE = ['username']
|
USER_IGNORE = ['username']
|
||||||
|
|
||||||
|
headers = {'X-Plex-Token': PLEX_TOKEN}
|
||||||
|
payload = {'allowSync': 1} # 1 = Allow, 0 = Not Allow
|
||||||
|
|
||||||
for user in plex.myPlexAccount().users():
|
for user in plex.myPlexAccount().users():
|
||||||
if user.title not in USER_IGNORE:
|
if user.title not in USER_IGNORE:
|
||||||
r = requests.put('http://plex.tv/api/friends/{}'.format(user.id), headers=headers, params=payload)
|
r = requests.put('http://plex.tv/api/friends/{}'.format(user.id), headers=headers, params=payload)
|
||||||
|
Reference in New Issue
Block a user