Last active
February 11, 2024 13:57
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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") |
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
@bbccdd use the new version; this copies a named playlist to another user; pls check the requirements