留点坑之后再填

This commit is contained in:
Jerry Yan 2022-06-05 09:38:48 +08:00
parent a595bcf731
commit 9fe1384b5d
3 changed files with 18 additions and 13 deletions

10
.gitignore vendored
View File

@ -1,2 +1,10 @@
evn/*
.DS_Store
.DS_Store
.idea
.vscode
venv
debug
error
__pycache__
*.py[cod]
*.xml

View File

@ -4,7 +4,10 @@ mitm:
port: 8080
webdriver:
bin: 'msedgedriver.exe'
headless: False
use: edge
edge:
bin: msedgedriver.exe
rooms:
- 19829678666

16
main.py
View File

@ -1,25 +1,19 @@
import sys
import threading
import subprocess
from urllib.parse import urlparse
from config.helper import config
from handler.http_server import app
from handler.utils import loop_queue
from scripts import webdriver
from browser.manager import BrowserManager
if __name__ == '__main__':
if len(sys.argv) == 1 or not urlparse(sys.argv[1]).scheme:
print('Invalid url provided, please check...')
sys.exit(1)
api_thread = threading.Thread(target=app.run, args=(config()["http"]["host"], config()["http"]["port"],))
api_thread.start()
mitmproxy_process = subprocess.Popen([
config()["mitm"]["bin"], "-s", "./scripts/mitmproxy.py", "-q",
config()["mitm"]["bin"], "-s", "./proxy_script.py", "-q",
"--listen-host", config()["mitm"]["host"], "--listen-port", str(config()["mitm"]["port"])
])
t = threading.Thread(target=webdriver.go, args=(sys.argv[1],))
t.start()
api_thread = threading.Thread(target=app.run, args=(config()["http"]["host"], config()["http"]["port"],))
api_thread.start()
manager = BrowserManager()
queue_thread = threading.Thread(target=loop_queue)
queue_thread.start()
queue_thread.join()