Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add playlist to multiple users #14

Open
aNerdgirl opened this issue Mar 13, 2022 · 24 comments
Open

Add playlist to multiple users #14

aNerdgirl opened this issue Mar 13, 2022 · 24 comments
Labels
enhancement New feature or request

Comments

@aNerdgirl
Copy link

First of all, thanks for the amazing script. It works very well.

I have a question/ feature request. Instead of adding the playlist 'only' for one user, I would like to add it to the main user + one additional user in plex. The reason: the audio app (Plexamp) doesn't show shared playlists, but only playlists created by the user.

Would it be possible to add this feature (or you could also give me a hint here and I could try myself). Thanks in advance.

@rnagabhyrava
Copy link
Owner

It's possible to copy playlist(s) created from main user to other users. But there are a few problems with it.

  1. Copying playlists with Playlist.copyToUser will NOT copy the posters and summary of the playlist.
  2. Will not delete existing playlists. Will keep on creating duplicate playlists on each copy.

Maybe there is a workaround to these but I haven't looked much into it.

You may ask why not just run another docker container with the user's credentials. I don't think this is not possible because the users will not have a plex token. I will leave this issue open.

@aNerdgirl
Copy link
Author

Thanks for the fast reply. Hm copy could be an option if I run it only once. However, I agree it is not suited for regular synchs.
I will have a look if there is a workaround, if I find something, I will let you know (though I am not too good with python).

I also tried to run the same script with a different plex token, and it indeed fails to work (as you said as well).

Thank you for your reply and effort!

@rnagabhyrava rnagabhyrava added the enhancement New feature or request label Mar 17, 2022
@anatosun
Copy link
Contributor

I see two ways to enable multiple user support without sharing from one user, which appears to me as a 'hack'.

  1. We use different profiles for each user which would be read from a config file. Each profile would have a different spotify id and deezer id as well as different plex credentials. This would require a slight rewrite of the present software.
  2. People that want to sync multiple users simply spawn multiple docker instances of the software.

@rnagabhyrava
Copy link
Owner

No offense but did you read completely said above?

You may ask why not just run another docker container with the user's credentials. I don't think this is not possible because the users will not have a plex token. I will leave this issue open.

Users WILL NOT have a plex token (only admin gets token) so cannot login to api which is needed to run api.

@anatosun
Copy link
Contributor

None taken, this is clearly my fault.

So only the first solution (in the two points I cited above) seems viable, right? Do you think an OAuth mechanism would work?

@rnagabhyrava
Copy link
Owner

You first point will also need some sort of plex authentication and token key from the user, users wont have token so not sure how this different from your other point. If you have a POC of this working, I am happy to implement it.

@rocstack
Copy link

@rnagabhyrava thanks for making this it's super useful!

I just wanted to add my own 2 cents to this. I've been able to create 2 containers for this (one for me and one for my partner) which synchronises our playlists against our Deezer and Plex account individually. I found out after quite a bit of research that home users also have plex tokens, you just have to dig around to find them. You have to log in as the managed user, open up the bottom console and go to the network tab and play songs etc and you find it here https://i.imgur.com/ainu7v1.png

The only issue is they don't get a poster assigned to the playlist - but I think that's a plex bug as managed users can't upload posters for some reason (unauthorized error 401). This is a bug report on plex so I think they'll fix it eventually.

Hope that's helpful to someone looking to do the same.

@rnagabhyrava
Copy link
Owner

@rocstack Thanks for digging into it. The reason for posters not showing up is very well do to access issue. I believe users will not have write access to the server. I may be wrong tho.... Anyways, thanks for the comment. I'll update the readme.

@rocstack
Copy link

No worries. I found out that if you get the managed users playlist ID you can upload it using the admin users token via the API. That way you get around the access issue.

So just make a POST request to this with the playlist ID and whatever image you want as a param:
http://192.168.0.21:32400/library/metadata/<playlistId>/posters?url=https://someimage.jpg&X-Plex-Token=XXXXXX

Not sure if that could be automated as part of this project - doing it manually is a bit tedious. Otherwise I'll create a script and share it.

@rnagabhyrava
Copy link
Owner

rnagabhyrava commented Oct 20, 2022 via email

@rocstack
Copy link

@rnagabhyrava thanks :)

@nath2125
Copy link

Has this been implemented into this project. I'm quite interested in having multiple users having Spotify playlists syncs. Seems easy enough after reading above to create another instance for each user and sync through finding their API. But unsure on the access poster thing. You mention it's a manual process, was there any development on automating this into the code?

@rocstack
Copy link

Has this been implemented into this project. I'm quite interested in having multiple users having Spotify playlists syncs. Seems easy enough after reading above to create another instance for each user and sync through finding their API. But unsure on the access poster thing. You mention it's a manual process, was there any development on automating this into the code?

Not sure if the repository's owner has done anything but I managed to automate all of the above. I would create a PR but the implementation is ugly (I'm not a python dev) and wouldn't want to scramble the existing codebase. So I just created a private fork and use it locally.

Happy to make that public?

@nath2125
Copy link

If you don't mind. I'm assuming it is as simple as taking and replacing this repository with yours? Since it's a copy of the original but changed? Do you have any documentation on additional things that are added, or is it pretty much the same with extra fields? How would I go about adding extra users on yours?

@rocstack
Copy link

Pretty much. I'd have build a new docker image for it to share. It would just need one additional field for all the plex users. It's just one container/instance which builds the playlists and copies them to all the users. I'll have a look this weekend.

@nath2125
Copy link

No worries, really appreciate your effort on this! But to clarify would it be user1spotify -> user1plex, user2spotify -> user2plex (since its using individual apis for each plex user, should I still assume your going that route?) or more of a case of user1spotify -> all plex users that you have listed in the field?

@rocstack
Copy link

It's just one Spotify account for api access. You define all the playlist IDs in the config and it pulls them from Spotify and copies them to the Plex accounts. You can also pull from playlist groups Spotify define like featured, top, indie, hip-hop etc.. Makes it a bit more dynamic. Might not be exactly what you're looking for but it works well for the accounts on my server.

@nath2125
Copy link

Yea, that sounds alright for what I'm doing. Could do it that way too, didn't think of that, instead of having each Spotify accounts with their playlists, just have one and pull the playlist IDs. That makes sense! Let me know when you finish up with it, so I can try out, thanks!

@nath2125
Copy link

nath2125 commented May 2, 2023

It's just one Spotify account for api access. You define all the playlist IDs in the config and it pulls them from Spotify and copies them to the Plex accounts. You can also pull from playlist groups Spotify define like featured, top, indie, hip-hop etc.. Makes it a bit more dynamic. Might not be exactly what you're looking for but it works well for the accounts on my server.

How did you go making it?

@rocstack
Copy link

rocstack commented May 2, 2023

How did you go making it?

Everything's working just not in a docker container. Nearly there..

@nath2125
Copy link

Any new updates on the docker container creation? Just thought I would check in?

@rocstack
Copy link

Yeah give it a try if you like. Let me know if you run into any issues.

@nath2125
Copy link

Do you mind opening the issues tab on your project? Running into a few problems not sure if its the way I have it configured or not

@rocstack
Copy link

Opened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants