zhou12189108 commited on
Commit
0114a7e
·
verified ·
1 Parent(s): ecb5447

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +6 -2
api.py CHANGED
@@ -71,8 +71,12 @@ def solver_captcha():
71
  data = request.get_json(force=True, silent=True)
72
  if not check_request(require_data, data):
73
  return jsonify(msg="Unauthorized Request"), 403
74
- resp = asyncio.run(hcaptcha_solver.main(data["host"], data["site_key"]))
75
- return resp
 
 
 
 
76
 
77
 
78
  @app.route("/api/update", methods=["POST"])
 
71
  data = request.get_json(force=True, silent=True)
72
  if not check_request(require_data, data):
73
  return jsonify(msg="Unauthorized Request"), 403
74
+ try:
75
+ resp = asyncio.run(hcaptcha_solver.main(data["host"], data["site_key"]))
76
+ return resp
77
+ except Exception as e:
78
+ print(e)
79
+ return "error",500
80
 
81
 
82
  @app.route("/api/update", methods=["POST"])