Created
June 25, 2022 23:07
-
-
Save yoosefi/69884937a4c471a488cf47adfe808ca3 to your computer and use it in GitHub Desktop.
plex: mark everything as watched
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/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