Skip to content

Instantly share code, notes, and snippets.

@murat3
Last active February 11, 2024 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save murat3/1eace37a6c4a681f19fb044690c2aaac to your computer and use it in GitHub Desktop.
Save murat3/1eace37a6c4a681f19fb044690c2aaac to your computer and use it in GitHub Desktop.
Plex: copy a named playlist from a managed users account to an admin account
#!/usr/bin/env python
#
# Description: Copy a named playlist to another user
# Author: murat3
# Requires:
# - python >=3.9
# - pip >=3.x
# - plexapi >=4.x
# - plex >=4.x
#
# Usage: python3 copy-playlist.py
#
# Tested with Plex 4.69.1
from plexapi.server import PlexServer
baseurl = 'http://plexhost:32400'
plexAdminToken = 'adminToken'
targetUser = 'targetUser'
nameOfPlaylistToCopy = 'aPlaylist'
plexAdmin = PlexServer(baseurl, plexAdminToken)
def main():
aPlaylist = plexAdmin.playlist(nameOfPlaylistToCopy)
aPlaylist.copyToUser(targetUser)
print('Playlist ' + aPlaylist.title + ' copied to user: ' + targetUser)
if __name__ == "__main__":
main()
print("Done")
@murat3
Copy link
Author

murat3 commented Jun 28, 2022

@bbccdd use the new version; this copies a named playlist to another user; pls check the requirements

@jasehigh
Copy link

Hi @murat3 this is great, but the playlist list presented often has non numeric (hex) identifiers, but the "Select the number of the playlist to copy from" prompt only accepts a numeric. Is there a work around for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment