|
|
|
@ -96,6 +96,7 @@ class DouyinLiveWebFetcher:
|
|
|
|
|
self.__ttwid = None
|
|
|
|
|
self.__room_id = None
|
|
|
|
|
self.live_id = LiveChatConfig().live_id
|
|
|
|
|
logger.info(f'self.live_id: {self.live_id}')
|
|
|
|
|
self.live_url = "https://live.douyin.com/"
|
|
|
|
|
self.user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) " \
|
|
|
|
|
"Chrome/120.0.0.0 Safari/537.36"
|
|
|
|
@ -103,7 +104,12 @@ class DouyinLiveWebFetcher:
|
|
|
|
|
self.ws_open_event = ws_open_event
|
|
|
|
|
|
|
|
|
|
def start(self):
|
|
|
|
|
self._connectWebSocket()
|
|
|
|
|
try:
|
|
|
|
|
self._connectWebSocket()
|
|
|
|
|
except Exception as e:
|
|
|
|
|
live_chat_config.update_chat_enable_status('启动失败')
|
|
|
|
|
logger.error(traceback.format_exc())
|
|
|
|
|
raise e
|
|
|
|
|
|
|
|
|
|
def stop(self):
|
|
|
|
|
self.ws.close()
|
|
|
|
@ -382,7 +388,7 @@ class DouyinLiveWebReply:
|
|
|
|
|
"""
|
|
|
|
|
优先从用户交互队列中取提示词,如果没有用户交互的数据,则输出系统提示词
|
|
|
|
|
"""
|
|
|
|
|
live_chat_config.update_chat_enable_status()
|
|
|
|
|
live_chat_config.update_chat_enable_status('已启动')
|
|
|
|
|
logger.info(f'livetalking address -> {self.live_chat_config.livetalking_address}')
|
|
|
|
|
logger.info(f'ollama_address -> {self.live_chat_config.ollama_address}')
|
|
|
|
|
while True:
|
|
|
|
|