From 736b59ff2796c0f7ceed7310373914b4c6ddf590 Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Sat, 30 Nov 2024 12:03:36 -0600 Subject: [PATCH] script to have plex sync subs --- plex.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 plex.py diff --git a/plex.py b/plex.py new file mode 100755 index 0000000..1688894 --- /dev/null +++ b/plex.py @@ -0,0 +1,16 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i python3 -p python3 python3Packages.plexapi + +from time import sleep +from plexapi.server import PlexServer + +baseurl = "http://server:32400" +token = "HYWgot9AsfbqGEvHCQrW" +plex = PlexServer(baseurl, token) + +for show in plex.library.section("TV Shows").all(): + print(f"Processing show: {show.title}") + for season in show.seasons(): + print(f" Analyzing season: {season.title}") + season.analyze() + print(f" Season '{season.title}' analyzed successfully.")