Update plexpy_sc.py

This commit is contained in:
12nick12 2019-02-06 19:40:54 -05:00 committed by GitHub
parent 787a8878d5
commit 686a716b42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -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