zhou12189108 commited on
Commit
6cf3c2b
1 Parent(s): 149b409

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +0 -1
  2. api.py +1 -10
Dockerfile CHANGED
@@ -40,7 +40,6 @@ RUN playwright install firefox --with-deps
40
  USER foxer
41
  RUN playwright install firefox
42
  COPY hcaptcha_solver.py .
43
- COPY get_all_model.py .
44
  COPY api.py .
45
  EXPOSE 7860
46
 
 
40
  USER foxer
41
  RUN playwright install firefox
42
  COPY hcaptcha_solver.py .
 
43
  COPY api.py .
44
  EXPOSE 7860
45
 
api.py CHANGED
@@ -5,7 +5,6 @@ import multiprocessing
5
  from flask import Flask, jsonify, request, logging as flog
6
  from flask_limiter.util import get_remote_address
7
  import hcaptcha_solver
8
- import get_all_model
9
 
10
  app = Flask(__name__)
11
 
@@ -38,13 +37,6 @@ def check_request(required_data, data):
38
  return False
39
  return True
40
 
41
-
42
- def update_models():
43
- while True:
44
- get_all_model.download_all()
45
- time.sleep(30 * 60)
46
-
47
-
48
  @app.errorhandler(429)
49
  def rate_limit_exceeded(e):
50
  print(get_remote_address())
@@ -82,6 +74,5 @@ def solver_captcha():
82
  return jsonify(msg="Unauthorized Request"), 403
83
  return asyncio.run(hcaptcha_solver.bytedance(data["host"], data["site_key"]))
84
 
85
- process = multiprocessing.Process(target=update_models)
86
- process.start()
87
  app.run(host="0.0.0.0", port=7860)
 
5
  from flask import Flask, jsonify, request, logging as flog
6
  from flask_limiter.util import get_remote_address
7
  import hcaptcha_solver
 
8
 
9
  app = Flask(__name__)
10
 
 
37
  return False
38
  return True
39
 
 
 
 
 
 
 
 
40
  @app.errorhandler(429)
41
  def rate_limit_exceeded(e):
42
  print(get_remote_address())
 
74
  return jsonify(msg="Unauthorized Request"), 403
75
  return asyncio.run(hcaptcha_solver.bytedance(data["host"], data["site_key"]))
76
 
77
+
 
78
  app.run(host="0.0.0.0", port=7860)