更新端口信息

main
fanpt 16 hours ago
parent 27dee15983
commit f1e78b51e5

@ -256,8 +256,8 @@ class LiveChatConfig:
for order_num, group_id, _type, msg in rows:
by_order.setdefault(order_num, [])
by_order[order_num].append({
"order": int(order_num),
"group": int(group_id),
"order": order_num,
"group": group_id,
"type": _type,
"message": msg
})

@ -1,3 +1,4 @@
import unicodedata
import asyncio
import codecs
import gzip
@ -418,13 +419,19 @@ class DouyinLiveWebReply:
logger.info(f'入库文案:{_type} | {message}')
def text_to_adio_cost_predict(self, text):
"""
计算文本转语音的耗时
计算文本转语音的耗时去除所有标点后再计算
:param text: 文本
:return: 耗时 单位秒
:return: 耗时
"""
return len(text)/4.6
if not text:
return 0.0
# 过滤所有属于 Unicode 标点类category 以 'P' 开头)的字符
no_punct = ''.join(ch for ch in text if unicodedata.category(ch)[0] != 'P')
return len(no_punct) / 4.62
def __call__(self):
"""

@ -10,7 +10,7 @@ logger.add("log.log", encoding="utf-8", rotation="500MB")
def start_fastapi_server(shared_config):
from app import app
app.shared_config = shared_config
uvicorn.run(app, host="0.0.0.0", port=8000)
uvicorn.run(app, host="0.0.0.0", port=8700)
def fetch_user_chat_content(ws_open_event, queue):
fetcher = DouyinLiveWebFetcher(ws_open_event, queue)

Loading…
Cancel
Save