fix dbshow #124
This commit is contained in:
parent
461e922dcf
commit
c4ec6386c7
@ -5,7 +5,7 @@
|
|||||||
# Author: xaoyaoo
|
# Author: xaoyaoo
|
||||||
# Date: 2023/10/14
|
# Date: 2023/10/14
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
__version__ = "3.1.25"
|
__version__ = "3.1.26"
|
||||||
|
|
||||||
import os, json
|
import os, json
|
||||||
|
|
||||||
|
@ -29,7 +29,8 @@ def gen_fastapi_app():
|
|||||||
app = FastAPI(title="pywxdump", description="微信工具", version=__version__,
|
app = FastAPI(title="pywxdump", description="微信工具", version=__version__,
|
||||||
terms_of_service="https://github.com/xaoyaoo/pywxdump",
|
terms_of_service="https://github.com/xaoyaoo/pywxdump",
|
||||||
contact={"name": "xaoyaoo", "url": "https://github.com/xaoyaoo/pywxdump"},
|
contact={"name": "xaoyaoo", "url": "https://github.com/xaoyaoo/pywxdump"},
|
||||||
license_info={"name": "MIT License", "url": "https://github.com/xaoyaoo/PyWxDump/blob/master/LICENSE"})
|
license_info={"name": "MIT License",
|
||||||
|
"url": "https://github.com/xaoyaoo/PyWxDump/blob/master/LICENSE"})
|
||||||
|
|
||||||
# 跨域
|
# 跨域
|
||||||
origins = [
|
origins = [
|
||||||
@ -70,7 +71,8 @@ def gen_fastapi_app():
|
|||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
def start_server(port=5000, online=False, debug=False, isopenBrowser=True):
|
def start_server(port=5000, online=False, debug=False, isopenBrowser=True,
|
||||||
|
merge_path="", wx_path="", my_wxid="", ):
|
||||||
"""
|
"""
|
||||||
启动flask
|
启动flask
|
||||||
:param port: 端口号
|
:param port: 端口号
|
||||||
@ -98,6 +100,15 @@ def start_server(port=5000, online=False, debug=False, isopenBrowser=True):
|
|||||||
f.write(f"PYWXDUMP_CONF_FILE = '{conf_file}'\n")
|
f.write(f"PYWXDUMP_CONF_FILE = '{conf_file}'\n")
|
||||||
f.write(f"PYWXDUMP_AUTO_SETTING = '{auto_setting}'\n")
|
f.write(f"PYWXDUMP_AUTO_SETTING = '{auto_setting}'\n")
|
||||||
|
|
||||||
|
if merge_path and os.path.exists(merge_path):
|
||||||
|
my_wxid = my_wxid if my_wxid else "wxid_dbshow"
|
||||||
|
gc.set_conf(my_wxid, "wxid", my_wxid) # 初始化wxid
|
||||||
|
gc.set_conf(my_wxid, "merge_path", merge_path) # 初始化merge_path
|
||||||
|
gc.set_conf(my_wxid, "wx_path", wx_path) # 初始化wx_path
|
||||||
|
db_config = {"key": my_wxid, "type": "sqlite", "path": merge_path}
|
||||||
|
gc.set_conf(my_wxid, "db_config", db_config) # 初始化db_config
|
||||||
|
gc.set_conf(auto_setting, "last", my_wxid) # 初始化last
|
||||||
|
|
||||||
# 检查端口是否被占用
|
# 检查端口是否被占用
|
||||||
if online:
|
if online:
|
||||||
host = '0.0.0.0'
|
host = '0.0.0.0'
|
||||||
|
@ -290,7 +290,7 @@ class MainShowChatRecords(BaseSubMainClass):
|
|||||||
print("[-] 输入数据库路径不存在")
|
print("[-] 输入数据库路径不存在")
|
||||||
return
|
return
|
||||||
|
|
||||||
start_server(merge_path=merge_path, wx_path=args.wx_path, key="", my_wxid=args.my_wxid, online=online)
|
start_server(merge_path=merge_path, wx_path=args.wx_path, my_wxid=args.my_wxid, online=online)
|
||||||
|
|
||||||
|
|
||||||
class MainExportChatRecords(BaseSubMainClass):
|
class MainExportChatRecords(BaseSubMainClass):
|
||||||
|
Loading…
Reference in New Issue
Block a user