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
|
# This reports the stream count
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import requests
|
import requests
|
||||||
import math
|
import math
|
||||||
|
|
||||||
host = ''
|
f = open("/home/hass/.homeassistant/python_scripts/plexpy/.creds", "r")
|
||||||
api_key = ''
|
data = f.read().splitlines()
|
||||||
url_base = 'not included slashes'
|
f.close()
|
||||||
ssl = 'true/false'
|
|
||||||
|
host = data[4]
|
||||||
|
api_key = data[5]
|
||||||
|
url_base = data[6]
|
||||||
|
ssl = data[7]
|
||||||
|
|
||||||
if ssl == 'true':
|
if ssl == 'true':
|
||||||
http = 'https'
|
http = 'https'
|
||||||
@ -17,9 +21,7 @@ if ssl == 'false':
|
|||||||
|
|
||||||
url = http + "://" + host + "/" + url_base + "/api/v2?apikey=" + api_key + "&cmd=get_activity"
|
url = http + "://" + host + "/" + url_base + "/api/v2?apikey=" + api_key + "&cmd=get_activity"
|
||||||
|
|
||||||
requests.packages.urllib3.disable_warnings()
|
response = requests.get(url)
|
||||||
|
|
||||||
response = requests.get(url, verify=False)
|
|
||||||
|
|
||||||
json_input = response.text
|
json_input = response.text
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user