lachesis/comcast

Doesn't work anymore?

Opened this issue · 3 comments

getting this when I run comcast.py...

DEBUG:__main__:Finding form inputs for login...
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): customer.xfinity.com:443
DEBUG:urllib3.connectionpool:https://customer.xfinity.com:443 "GET /oauth/force_connect/?continue=%23%2Fdevices HTTP/1.1" 302 None
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): oauth.xfinity.com:443
DEBUG:urllib3.connectionpool:https://oauth.xfinity.com:443 "GET /oauth/authorize?client_id=my-account-web&prompt=login&redirect_uri=https%3A%2F%2Fcustomer.xfinity.com%2Foauth%2Fcallback&response_type=code&state=%23%2Fdevices HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): login.xfinity.com:443
DEBUG:urllib3.connectionpool:https://login.xfinity.com:443 "GET /login?r=comcast.net&s=oauth&continue=https%3A%2F%2Foauth.xfinity.com%2Foauth%2Fauthorize%3Fclient_id%3Dmy-account-web%26prompt%3Dlogin%26redirect_uri%3Dhttps%253A%252F%252Fcustomer.xfinity.com%252Foauth%252Fcallback%26response_type%3Dcode%26state%3D%2523%252Fdevices%26response%3D1&client_id=my-account-web&reqId=xxxx&forceAuthn=1 HTTP/1.1" 200 4510
DEBUG:__main__:Found with the following input fields: {'<input type="checkbox" id="remember_me" name="rm" value="1" >': 'rm', '<input type="hidden" name="r" value="comcast.net">': 'r', '<input type="hidden" name="selectAccount" value="false">': 'selectAccount', '<input type="hidden" name="s" value="oauth">': 's', '<input type="hidden" name="deviceAuthn" value="false">': 'deviceAuthn', '<input type="hidden" name="continue" value="https://oauth.xfinity.com/oauth/authorize?client_id=my-account-web&amp;prompt=login&amp;redirect_uri=https%3A%2F%2Fcustomer.xfinity.com%2Foauth%2Fcallback&amp;response_type=code&amp;state=%23%2Fdevices&amp;response=1">': 'continue', '<input type="hidden" name="ipAddrAuthn" value="false">': 'ipAddrAuthn', '<input type="hidden" name="forceAuthn" value="1">': 'forceAuthn', '<input type="hidden" name="lang" value="en">': 'lang', '<input type="hidden" name="passive" value="false">': 'passive', '<input type="hidden" name="client_id" value="my-account-web">': 'client_id', '<input type="hidden" name="reqId" value="xxxx">': 'reqId'}
DEBUG:__main__:Posting to login...
DEBUG:urllib3.connectionpool:Resetting dropped connection: login.xfinity.com
DEBUG:urllib3.connectionpool:https://login.xfinity.com:443 "POST /login HTTP/1.1" 200 4251
DEBUG:__main__:Fetching internet usage AJAX...
DEBUG:urllib3.connectionpool:Resetting dropped connection: customer.xfinity.com
DEBUG:urllib3.connectionpool:https://customer.xfinity.com:443 "GET /apis/services/internet/usage HTTP/1.1" 401 None
Traceback (most recent call last):
  File "/Users/dwight/projects/comcast/comcast.py", line 45, in <module>
    assert res.status_code == 200
AssertionError

I'm not a comcast customer anymore

I'm so looking forward to that day...

blegh. I have the same issue with https://github.com/normanr/xfinitybilldownload. It looks like comcast changed their login flow. They now require a user-agent and add some hidden fields using obfuscated javascript (that might do browser fingerprinting?) when submitting the login form. They also send a confirmation code to your mobile as a second factor check (which needs to be entered to continue, but can be stored in your cookies to keep it for next time).