commit 7cd0ce0ff13a9bf578f74766e717a7f8bd3d32e8 Author: Adrian Sampson Date: Sat Jan 6 13:21:57 2018 -0800 Fetch gateway data diff --git a/wideq.py b/wideq.py new file mode 100644 index 0000000..40a755a --- /dev/null +++ b/wideq.py @@ -0,0 +1,21 @@ +import requests + +GATEWAY_URL = 'https://kic.lgthinq.com:46030/api/common/gatewayUriList' +APP_KEY = 'wideq' +SECURITY_KEY = 'nuts_securitykey' +DATA_ROOT = 'lgedmRoot' + + +def gateway_info(country='US', lang='en-US'): + req_data = {DATA_ROOT: {'countryCode': country, 'langCode': lang}} + headers = { + 'x-thinq-application-key': APP_KEY, + 'x-thinq-security-key': SECURITY_KEY, + 'Accept': 'application/json', + } + res = requests.post(GATEWAY_URL, json=req_data, headers=headers) + return res.json() + + +if __name__ == '__main__': + print(gateway_info())