Update plexpy_sc.py
This commit is contained in:
parent
787a8878d5
commit
686a716b42
18
plexpy_sc.py
18
plexpy_sc.py
|
@ -1,14 +1,18 @@
|
|||
#!/usr/bin/env python
|
||||
# This reports the stream count
|
||||
#!/usr/bin/env python
|
||||
|
||||
import json
|
||||
import requests
|
||||
import math
|
||||
|
||||
host = ''
|
||||
api_key = ''
|
||||
url_base = 'not included slashes'
|
||||
ssl = 'true/false'
|
||||
f = open("/home/hass/.homeassistant/python_scripts/plexpy/.creds", "r")
|
||||
data = f.read().splitlines()
|
||||
f.close()
|
||||
|
||||
host = data[4]
|
||||
api_key = data[5]
|
||||
url_base = data[6]
|
||||
ssl = data[7]
|
||||
|
||||
if ssl == 'true':
|
||||
http = 'https'
|
||||
|
@ -17,9 +21,7 @@ if ssl == 'false':
|
|||
|
||||
url = http + "://" + host + "/" + url_base + "/api/v2?apikey=" + api_key + "&cmd=get_activity"
|
||||
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
|
||||
response = requests.get(url, verify=False)
|
||||
response = requests.get(url)
|
||||
|
||||
json_input = response.text
|
||||
|
||||
|
|
Loading…
Reference in New Issue