Skip to content

Instantly share code, notes, and snippets.

@blacktwin
Last active February 22, 2020 03:42
Show Gist options
  • Save blacktwin/dc0dcd216038a0b1af8ddbf2d186b58c to your computer and use it in GitHub Desktop.
Save blacktwin/dc0dcd216038a0b1af8ddbf2d186b58c to your computer and use it in GitHub Desktop.
Mark everything shared with guest account as unwatched.
from plexapi.server import PlexServer
import requests
# Edit these
PLEX_URL = ''
PLEX_TOKEN = ''
#
sess = requests.Session()
sess.verify = False
plex = PlexServer(PLEX_URL, PLEX_TOKEN, session=sess)
guest = plex.myPlexAccount().user("Guest")
token = guest.get_token(plex.machineIdentifier)
guest_plex = PlexServer(PLEX_URL, token, session=sess)
guest_sections = guest_plex.library.sections()
for section in guest_sections:
print("Marking section: {} unwatched.".format(section.title))
for items in section.all():
print("Marking item: {} unwatched.".format(items.title))
items.markUnwatched()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment