diff --git a/fb_auth_token.py b/fb_auth_token.py index fcede72..ed2fcdf 100644 --- a/fb_auth_token.py +++ b/fb_auth_token.py @@ -22,10 +22,6 @@ def get_fb_access_token(email, password): access_token = re.search( r"access_token=([\w\d]+)", s.response.content.decode()).groups()[0] return access_token - except requests.exceptions.InvalidSchema as browserAddress: - access_token = re.search( - r"access_token=([\w\d]+)",str(browserAddress)).groups()[0] - return access_token except Exception as ex: print("access token could not be retrieved. Check your username and password.") print("Official error: %s" % ex) diff --git a/tinder_api.py b/tinder_api.py index 6398fc0..2cf8596 100644 --- a/tinder_api.py +++ b/tinder_api.py @@ -18,14 +18,14 @@ def get_auth_token(fb_auth_token, fb_user_id): return {"error": "could not retrieve fb_auth_token"} if "error" in fb_user_id: return {"error": "could not retrieve fb_user_id"} - url = config.host + '/v2/auth/login/facebook' + url = config.host + '/auth' req = requests.post(url, headers=headers, data=json.dumps( - {'token': fb_auth_token, 'facebook_id': fb_user_id}) + {'facebook_token': fb_auth_token, 'facebook_id': fb_user_id}) ) try: - tinder_auth_token = req.json()["data"]["api_token"] + tinder_auth_token = req.json()["token"] headers.update({"X-Auth-Token": tinder_auth_token}) get_headers.update({"X-Auth-Token": tinder_auth_token}) print("You have been successfully authorized!")