Last active
February 22, 2020 03:42
-
-
Save blacktwin/dc0dcd216038a0b1af8ddbf2d186b58c to your computer and use it in GitHub Desktop.
Mark everything shared with guest account as unwatched.
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
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