Update server.py

This commit is contained in:
Namhyeon Go 2024-02-19 16:16:41 +09:00 committed by GitHub
parent c005db0058
commit 60c6b1f541
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -205,8 +205,11 @@ def proxy_check_filtered(data, webserver, port, scheme, method, url):
if encoded_image: if encoded_image:
print ("[*] solving...") print ("[*] solving...")
solved = truecaptcha_solve(base64string) solved = truecaptcha_solve(base64string)
print ("[*] solved: %s" % (solved)) if solved:
filtered = solved in ['ctkpaarr', 'SPAM'] print ("[*] solved: %s" % (solved))
filtered = solved in ['ctkpaarr', 'SPAM']
else:
print ("[*] not solved")
# take action # take action
if filtered: if filtered:
@ -422,8 +425,14 @@ def truecaptcha_solve(encoded_image):
} }
response = requests.post(url = url, json = data) response = requests.post(url = url, json = data)
data = response.json() data = response.json()
print (data)
return data['result'] if 'error_message' in data:
print ("[*] Error: %s" % (data['error_message']))
return None
if 'result' in data:
return data['result']
return None
if __name__== "__main__": if __name__== "__main__":
start() start()