This commit is contained in:
deathbybandaid 2024-02-21 10:13:42 -05:00
parent eae84e1800
commit 44eee34670

View File

@ -12,11 +12,7 @@ urllib3.disable_warnings()
SCRIPT_DIR = pathlib.Path(os.path.dirname(os.path.abspath(__file__))) SCRIPT_DIR = pathlib.Path(os.path.dirname(os.path.abspath(__file__)))
# PLEX_URL = "http://127.0.0.1:32400" class PLEX_INFO():
# PLEX_TOKEN = 'GfMXZTPscfvLazy_pyLP'
class plex_info():
def __init__(self): def __init__(self):
pass pass
@ -37,21 +33,24 @@ class plex_info():
def token(self): def token(self):
token_script = pathlib.Path(SCRIPT_DIR).joinpath('plex-token.sh') token_script = pathlib.Path(SCRIPT_DIR).joinpath('plex-token.sh')
token_proc = subprocess.Popen(['/bin/bash', token_script], stdout=subprocess.PIPE) token_proc = subprocess.Popen(['/bin/bash', token_script], stdout=subprocess.PIPE)
#token = token_proc.stdout.read().decode().strip("\n") token = token_proc.stdout.read().decode().strip("\n")
#token_proc.terminate() token_proc.terminate()
#token_proc.communicate() token_proc.communicate()
#token_proc.kill() token_proc.kill()
# token = subprocess.run(['/bin/bash', token_script], capture_output=True, text=True).stdout # token = subprocess.run(['/bin/bash', token_script], capture_output=True, text=True).stdout
return token_script return token
@property @property
def url(self): def url(self):
return '%s%s:%s' % (self.proto, self.address, str(self.port)) return '%s%s:%s' % (self.proto, self.address, str(self.port))
print(plex_info.token) plex_info = PLEX_INFO()
print(plex_info.url)
print(PLEX_INFO.token)
print(PLEX_INFO.url)
#sess = requests.Session() #sess = requests.Session()
#sess.verify = False #sess.verify = False