From 44eee34670c3756295be9c12daf883050dfe0f40 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Wed, 21 Feb 2024 10:13:42 -0500 Subject: [PATCH] test --- remove_lonely_collections.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/remove_lonely_collections.py b/remove_lonely_collections.py index 74393ea..a68482a 100644 --- a/remove_lonely_collections.py +++ b/remove_lonely_collections.py @@ -12,11 +12,7 @@ urllib3.disable_warnings() SCRIPT_DIR = pathlib.Path(os.path.dirname(os.path.abspath(__file__))) -# PLEX_URL = "http://127.0.0.1:32400" -# PLEX_TOKEN = 'GfMXZTPscfvLazy_pyLP' - - -class plex_info(): +class PLEX_INFO(): def __init__(self): pass @@ -37,21 +33,24 @@ class plex_info(): def token(self): token_script = pathlib.Path(SCRIPT_DIR).joinpath('plex-token.sh') token_proc = subprocess.Popen(['/bin/bash', token_script], stdout=subprocess.PIPE) - #token = token_proc.stdout.read().decode().strip("\n") - #token_proc.terminate() - #token_proc.communicate() - #token_proc.kill() + token = token_proc.stdout.read().decode().strip("\n") + token_proc.terminate() + token_proc.communicate() + token_proc.kill() # token = subprocess.run(['/bin/bash', token_script], capture_output=True, text=True).stdout - return token_script + return token @property def url(self): return '%s%s:%s' % (self.proto, self.address, str(self.port)) -print(plex_info.token) -print(plex_info.url) +plex_info = PLEX_INFO() + + +print(PLEX_INFO.token) +print(PLEX_INFO.url) #sess = requests.Session() #sess.verify = False