From a9aa9bc7ede10eeed738c3b77e726ad4468e797a Mon Sep 17 00:00:00 2001 From: Zachary Vance Date: Tue, 20 Jun 2017 13:57:25 -0700 Subject: [PATCH] Speed up comcast bandwidth check --- cgi-bin/comcast.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cgi-bin/comcast.py b/cgi-bin/comcast.py index adb4225..01b65ad 100644 --- a/cgi-bin/comcast.py +++ b/cgi-bin/comcast.py @@ -19,7 +19,7 @@ username = os.environ['COMCAST_USERNAME'] password = os.environ['COMCAST_PASSWORD'] logger.debug("Finding req_id for login...") -res = session.get('https://login.comcast.net/login?r=comcast.net&s=oauth&continue=https%3A%2F%2Flogin.comcast.net%2Foauth%2Fauthorize%3Fclient_id%3Dmy-account-web%26redirect_uri%3Dhttps%253A%252F%252Fcustomer.xfinity.com%252Foauth%252Fcallback%26response_type%3Dcode%26state%3D%2523%252Fdevices%26response%3D1&client_id=my-account-web') +res = session.post('https://login.comcast.net/login?r=comcast.net&s=oauth&continue=https%3A%2F%2Flogin.comcast.net%2Foauth%2Fauthorize%3Fclient_id%3Dmy-account-web%26redirect_uri%3Dhttps%253A%252F%252Fcustomer.xfinity.com%252Foauth%252Fcallback%26response_type%3Dcode%26state%3D%2523%252Fdevices%26response%3D1&client_id=my-account-web') assert res.status_code == 200 m = re.search(r'', res.text) req_id = m.group(1) @@ -41,8 +41,8 @@ data = { } logger.debug("Posting to login...") -res = session.post('https://login.comcast.net/login', data=data) -assert res.status_code == 200 +res = session.post('https://login.comcast.net/login', data=data, allow_redirects=False) +assert res.status_code == 302 #logger.debug("Preloader HTML...") #res = session.get('https://customer.xfinity.com/Secure/Preloading/?backTo=%2fMyServices%2fInternet%2fUsageMeter%2f') -- 2.47.3