Created
July 26, 2022 15:02
-
-
Save wilpig/9d9600840e5481af3169b44da7bcccd6 to your computer and use it in GitHub Desktop.
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
#!/bin/python3 | |
import re | |
import subprocess | |
import sys | |
try: | |
from plexapi.server import PlexServer | |
except ImportError or ModuleNotFoundError: | |
print ('python-plex module is missing run pip3 install plexapi') | |
sys.exit(1) | |
baseurl = 'http://plex.wilpig.org:32400' | |
token = '<TOKEN GOES HERE>' | |
plex = PlexServer(baseurl, token) | |
output = subprocess.check_output("find /Volumes/media2/movies.hd/ -type f -mmin -360 -exec basename {} \;", shell=True) | |
for title in output.decode().split('\n'): | |
title=re.match('(^.*)\ \([0-9]{4}\).*',title) | |
if title: | |
for x in plex.library.section('Movies').search(title[1]): | |
print (x.title) | |
x.analyze() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment