Created
November 24, 2014 10:30
-
-
Save svenstaro/04b7c0ec8421ff8b2c64 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def verify_recaptcha(challenge, response, private_key, remote_ip): | |
payload = { | |
"privatekey": private_key, | |
"remoteip": remote_ip, | |
"challenge": challenge, | |
"response": response | |
} | |
resp = requests.post("https://www.google.com/recaptcha/api/verify", data=payload) | |
resp_data = resp.text.splitlines() | |
return resp.status_code == requests.codes.ok and (resp_data[0] == 'true') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment