Skip to content

Instantly share code, notes, and snippets.

@yoosefi
Created June 25, 2022 23:07
Show Gist options
  • Save yoosefi/69884937a4c471a488cf47adfe808ca3 to your computer and use it in GitHub Desktop.
Save yoosefi/69884937a4c471a488cf47adfe808ca3 to your computer and use it in GitHub Desktop.
plex: mark everything as watched
#!/usr/bin/python
## requires plexapi
## $ pip install plexapi
from plexapi.server import PlexServer
# admin token can be seen in the url when "Get Info > View XML" is opened.
plex = PlexServer('http://localhost:32400', 'ADMIN TOKEN HERE')
# tv show libraries
for lib in ['TV', 'etc']:
section = plex.library.section(lib)
for show in section.all():
for ep in show.episodes():
if not ep.isWatched:
ep.markWatched()
print(section.title,'/',show.title,'/',ep.title)
# movie libraries
for lib in ['Movies', 'etc']:
section = plex.library.section(lib)
for movie in section.all():
if not movie.isWatched:
movie.markWatched()
print(section.title,'/',movie.title)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment