test
This commit is contained in:
parent
eae84e1800
commit
44eee34670
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user