diff --git a/plexpy_sc.py b/plexpy_sc.py index 71830f5..a4f2bc5 100644 --- a/plexpy_sc.py +++ b/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