Help with script to remove watched items from watchlist

Can someone help with this script please?
I keep getting 404 errors but the metadata is up to date. Here is my code

Blockquote
from plexapi.myplex import MyPlexAccount
from plexapi.server import PlexServer
from plexapi.exceptions import NotFound

baseurl = ‘http://192.168.100.191:32400
token = ‘secret’
plex = PlexServer(baseurl, token)
account = MyPlexAccount(token=token)

Watchlist for all TV shows sorted by title in ascending order

watchlist = account.watchlist(sort=‘titleSort:asc’, libtype=‘show’)

Remove the items in the watchlist that have been watched

for item in watchlist:
try:
watched = all(episode.isWatched for episode in item.episodes())
if watched:
print(f’Removing {item.title} from watchlist’)
# item.removeFromWatchlist()
except NotFound:
print(f’Could not fetch episodes for {item.title}')

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.