How do I see which users a particular library is shared with?

Server Version#: 1.18.5.2309

I know that I can go into Settings–>Users & Sharing, and click on each individual user to see which libraries I’m sharing with them, but is there a way I can do this at the library level? I want to be able to click on a library and see every user that the library is currently being shared with instead of having to click on 30 users one at a time to see if a particular library is shared or not.

Go to dashboard on Plex server, scroll down to Play History/ View All History

1 Like

Thanks SE56, viewing all of the play history is definitely a way to see if a particular user has ever played something in a particular library or not, but if they have access to a particular library but have never played anything in it, I don’t believe it would show up here. I’m looking for a quick way to see everyone that a particular library is shared with regardless if they’ve ever played something in it or not. (Currently, I have to go user by user.) Thanks for showing me this though. I use Tautulli for all of my play activity so had never really drilled down to this before within Plex. Appreciate it!

Well I am not sure but this does do a lot.

https://forums.plex.tv/t/rel-webtools-unsupported-appstore/206843

Webtools can’t tell you this.

1 Like

Try this Python script with the --libraryShares argument.

1 Like

Gave it a try from the command prompt in Windows 10 but it looks like it didn’t like some of the import statements…I’ll keep messing with it:

C:\python>python plex_api_share.py --help
Traceback (most recent call last):
File “plex_api_share.py”, line 102, in
from plexapi.server import PlexServer, CONFIG
ModuleNotFoundError: No module named ‘plexapi’

C:\python>

You’ll need to install the plexapi Python library. pip install plexapi

1 Like

Thanks, that got me a little further. It’s getting there! :smiley:

C:\python>python plex_api_share.py --help
Traceback (most recent call last):
File “plex_api_share.py”, line 113, in
PLEX_URL = CONFIG.data[‘auth’].get(‘server_baseurl’, ‘’)
KeyError: ‘auth’

C:\python>

You need to add your Plex url and Plex token. Lines 109 & 110.

PLEX_URL = ''
PLEX_TOKEN = ''
1 Like

Thanks, I modified the script and added the server url and the token to the variables, and it ran for like 10 seconds and then displayed:

C:\python>python plex_api_share.py --help
Traceback (most recent call last):
File “plex_api_share.py”, line 135, in
user_choices = list(set(user_lst.values() + user_lst.keys()))
TypeError: unsupported operand type(s) for +: ‘dict_values’ and ‘dict_keys’

C:\python>

You’re running the script with Python 3.x and it’s written with 2.7. Sorry for all the hoops for a simple request. Quick edit and pushed. Download the file and try again.

1 Like

oh no worries, I just really appreciate the help! Tried it with the new script and it ran longer this time:

C:\python>python plex_api_share.py --libraryShares
Traceback (most recent call last):
File “plex_api_share.py”, line 295, in
movie_ratings += get_ratings_lst(movie)
File “plex_api_share.py”, line 158, in get_ratings_lst
ratings_keys = content.json()[‘MediaContainer’][‘Directory’]
File “C:\Users\Chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\requests\models.py”, line 897, in json
return complexjson.loads(self.text, **kwargs)
File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\json_init_.py”, line 348, in loads
return _default_decoder.decode(s)
File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\json\decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\json\decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Oh boi. So since all you’re looking for is the library shares switch Line 291 from True to False.

if plex.myPlexSubscription is True:
# to
if plex.myPlexSubscription is False:

What is happening is that the script tries to load as much information as possible to be able to use it for choices in the arguments. So you couldn’t input an invalid choice like library name or user name when using the other features the script offers.

The problem you’re seeing is that it’s trying to pull all the ratings available since you have Plex Pass. There is an issue with pulling the ratings, could be your Plex Pass is a subscription and the data or endpoint is different than LifeTime Pass or there is an invalid rating or something else completely. So the quick and dirty solution to get what you initially wanted, just make the script skip this check for ratings. The simple edit above should do that.

Without the edit I would assume that using python plex_api_share.py -h would result in the same error.

EDIT: Or the API server is down again. lol

1 Like

The auth API has degraded performance, currently. Could be related.
http://status.plex.tv/

1 Like

woo hoo that did it! I do have a LifeTime Pass so it must be something else…but changing this caused it to display “No Plex Pass moving on…” and then it listed each library and the assigned users which is EXACTLY what I was looking for!

Thank you so much for all of your help! I sincerely appreciate it!!!

P.S. Yes you were absolutely correct, the -h argument was giving the exact same error until I modified the script to: if plex.myPlexSubscription is False

Also something interesting, I notice it doesn’t show any library where me as the admin user is the only user that has access…only if I’ve shared it with at least one other user does it show up in the script results…which is cool…so if I have a library called Movies-Private and I only temporarily share it with a few users, I can run this script to remember who those users were, individually remove access, and then the library should disappear completely from the script results. Cool! Thanks again!

Missing Admin from libraries listing is correct as Admin cannot be restricted in any way.

Check out some of the other features for the script. You can bulk add or remove access to libraries, create backups of your share settings, restore settings from backups, and make changes to users content restrictions, once the API server is functioning properly again and flip False back to True :grinning:. There are a couple examples at the top of the script.

Also check out the rest of that repository. Contact info is here if you ever have a question or problem.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.