-
-
Save JonnyWong16/f8139216e2748cb367558070c1448636 to your computer and use it in GitHub Desktop.
i get a error :
PS C:\Users\Administrator> C:\Python27\python.exe C:\Plexpy\share_unshare_libraries.py unshare
line 7 cannot import requests
Just posting that I also get errors. Specifically just trying with the POST code only to update a shared Library, but i get the returned response code:
Tried with some general python POSTS but kept getting returned with:
<Response code="400" status="You're already sharing this server with plexFriend. Please edit your existing share."/>
Was using the following POST:
headers = {"X-Plex-Token": 'Ycx2134yTyaJHGFxKtgezn9',
"Accept": "application/json"}
url = "https://plex.tv/api/servers/GUte86560eJHGa7fagde5j77dd4bjgrLGHT05/shared_servers"
payload = {"server_id": "GUte86560eJHGa7fagde5j77dd4bjgrLGHT05",
"shared_server": {"library_section_ids": "[35723967]",
"invited_id": "2120385"}
}
r = requests.post(url, headers=headers, json=payload)
So I must have been doing the request wrong.
(Tokens in code all fake)
Hello,
I've got this to work..sort of. When I do the unshare it unshares for all 4 users, however when I do the share function it will only share for 1 of the users, and if I attempt to re-run the share it stops and says I'm already sharing. Any idea why this could be?
This script works for unsharing all users, but like tweakfour17 said, it will only enable sharing for 1 user then stops. I'm too stupid to troubleshoot this - hopefully someone can figure it out.
@haltdev and @tweakfour17.
If you're still curious about why the script stops after sharing with one user; there's a return statement on line 50 that interrupts the for loop. Just remove it and it'll handle multiple users fine.
Howdy, is there an endpoint for retrieving the ID of a user by their email?
I got a error when i try this very amazing script :(