diff --git a/remove_lonely_collections.py b/remove_lonely_collections.py index ef9c5f6..cccce12 100644 --- a/remove_lonely_collections.py +++ b/remove_lonely_collections.py @@ -33,7 +33,13 @@ class plex_info(): @property def token(self): token_script = pathlib.Path(SCRIPT_DIR).joinpath('plex-token.sh') - token = subprocess.run(['/bin/bash', token_script], capture_output=True, text=True).stdout + 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 = subprocess.run(['/bin/bash', token_script], capture_output=True, text=True).stdout return token @property