Skip to content

Commit

Permalink
retrieve access token from headers
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud78 committed Jun 11, 2020
1 parent 3abc3de commit 9209f8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fb_auth_token.py
Original file line number Diff line number Diff line change
@@ -22,6 +22,10 @@ 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)

0 comments on commit 9209f8a

Please sign in to comment.