lachesis / comcast

Script for tracking Comcast data cap usage
MIT License
22 stars 6 forks source link

Doesn't work anymore? #3

Open dwightmulcahy opened 3 years ago

dwightmulcahy commented 3 years ago

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
lachesis commented 3 years ago

Yeah they changed login again and it is busted. Last time I looked at it the fix was non-trivial, seemed like some kind of anti-bot. I'm not a comcast customer anymore, thank goodness, so I will probably not fix it.

On Tue, Oct 20, 2020, 10:58 dWiGhT notifications@github.com wrote:

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: {'': 'rm', '': 'r', '': 'selectAccount', '': 's', '': 'deviceAuthn', '': 'continue', '': 'ipAddrAuthn', '': 'forceAuthn', '': 'lang', '': 'passive', '': 'client_id', '': '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 assert res.status_code == 200 AssertionError

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lachesis/comcast/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACU2WIOC74AW34FGB5ZZ4TSLXFVFANCNFSM4SYV57GA .

dwightmulcahy commented 3 years ago

I'm not a comcast customer anymore

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

normanr commented 3 years ago

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).