You've already forked Douyin_Web_Live
尝试大改,可读性有点差的版本,基本做到能实时处理弹幕
This commit is contained in:
19
main.py
19
main.py
@ -1,18 +1,27 @@
|
||||
import sys
|
||||
import threading
|
||||
import subprocess
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from scripts import watcher, webdriver
|
||||
from config.helper import config
|
||||
from handler.http_server import app
|
||||
from handler.utils import loop_queue
|
||||
from scripts import webdriver
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) == 1 or not urlparse(sys.argv[1]).scheme:
|
||||
print('Invalid url provided, please check...')
|
||||
sys.exit(1)
|
||||
|
||||
t = threading.Thread(target=webdriver.go, args=(sys.argv[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",
|
||||
"--listen-host", config()["mitm"]["host"], "--listen-port", str(config()["mitm"]["port"])
|
||||
])
|
||||
t = threading.Thread(target=webdriver.go)
|
||||
t.start()
|
||||
queue_thread = threading.Thread(target=loop_queue)
|
||||
queue_thread.start()
|
||||
queue_thread.join()
|
||||
|
||||
w = watcher.Watcher(directory=config()['watchdog']['dir'])
|
||||
w.run()
|
||||
|
||||
|
Reference in New Issue
Block a user