Skip to content

Instantly share code, notes, and snippets.

@JonnyWong16
Last active October 20, 2023 22:34
Show Gist options
  • Save JonnyWong16/34878448ab45dfffffa930f5cf8c252a to your computer and use it in GitHub Desktop.
Save JonnyWong16/34878448ab45dfffffa930f5cf8c252a to your computer and use it in GitHub Desktop.
Removes ALL collections from ALL movies.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Removes ALL collections from ALL movies.
# Author: /u/SwiftPanda16
# Requires: plexapi
from plexapi.server import PlexServer
### EDIT SETTINGS ###
PLEX_URL = "http://localhost:32400"
PLEX_TOKEN = "xxxxxxxxxx"
MOVIE_LIBRARY_NAME = "Movies"
## CODE BELOW ##
plex = PlexServer(PLEX_URL, PLEX_TOKEN)
for movie in plex.library.section(MOVIE_LIBRARY_NAME).all():
movie.removeCollection([c.tag for c in movie.collections])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment