1、修复隐藏看板娘后js报错;
2、使用显式浏览器获取抖音互动数据,解决抖音数据不稳定问题。
This commit is contained in:
xszyou 2023-02-07 11:38:06 +08:00
parent 88ed6984f0
commit 9067b05ef1
3 changed files with 6 additions and 20 deletions

View File

@ -281,20 +281,6 @@ class FeiFei:
amount = interact.data["gifts"][i]["amount"] amount = interact.data["gifts"][i]["amount"]
msg += "{}送给我的{}{}".format(user, amount, gift[1]) msg += "{}送给我的{}{}".format(user, amount, gift[1])
self.a_msg = '感谢感谢,感谢' + msg self.a_msg = '感谢感谢,感谢' + msg
# elif index == 5:
# msg = ""
# for index in range(1, len(interact), 4):
# try:
# gift = interact[index + 2]
# gift_name = '礼物'
# if gift[0] != -1:
# gift_name = gift[1]
# msg = msg + "{}送给我的{}个{}".format(interact[index], interact[index + 3], gift_name)
# except BaseException as e:
# print("[System] 礼物处理错误!")
# print(e)
# self.a_msg = '感谢感谢,感谢' + msg
self.last_speak_data = self.a_msg self.last_speak_data = self.a_msg
self.speaking = True self.speaking = True
MyThread(target=self.__say, args=['interact']).start() MyThread(target=self.__say, args=['interact']).start()

View File

@ -41,17 +41,17 @@ class Viewer:
def __start(self): def __start(self):
MyThread(target=self.__driver_alive_runnable).start() MyThread(target=self.__driver_alive_runnable).start()
self.chrome_options = Options() self.chrome_options = Options()
self.chrome_options.add_argument('--headless') # self.chrome_options.add_argument('--headless')
self.chrome_options.add_argument('--blink-settings=imagesEnabled=false') # self.chrome_options.add_argument('--blink-settings=imagesEnabled=false')
self.live_driver = webdriver.Chrome(config_util.system_chrome_driver, options=self.chrome_options) self.live_driver = webdriver.Chrome(config_util.system_chrome_driver, options=self.chrome_options)
self.live_driver.get(self.url) self.live_driver.get(self.url)
self.user_driver = webdriver.Chrome(config_util.system_chrome_driver, options=self.chrome_options) # self.user_driver = webdriver.Chrome(config_util.system_chrome_driver, options=self.chrome_options)#抖音加了验证码,暂时不获取粉丝数
self.__wait_live_start() self.__wait_live_start()
self.user_sec_uid = self.__get_render_data(self.live_driver)['app']['initialState']['roomStore']['roomInfo']['room']['owner']['sec_uid'] self.user_sec_uid = self.__get_render_data(self.live_driver)['app']['initialState']['roomStore']['roomInfo']['room']['owner']['sec_uid']
MyThread(target=self.__live_state_runnable).start() MyThread(target=self.__live_state_runnable).start()
MyThread(target=self.__join_runnable).start() MyThread(target=self.__join_runnable).start()
MyThread(target=self.__interact_runnable).start() MyThread(target=self.__interact_runnable).start()
MyThread(target=self.__follower_runnable).start() # MyThread(target=self.__follower_runnable).start() #抖音加了验证码,暂时不获取粉丝数
def start(self): def start(self):
MyThread(target=self.__start).start() MyThread(target=self.__start).start()

View File

@ -183,9 +183,9 @@ new Vue({
//Edit by xszyou in 2022/2/3:同步到看板娘 //Edit by xszyou in 2022/2/3:同步到看板娘
text = panelMsg; text = panelMsg;
if (panelMsg != ""){ const tips = document.getElementById("waifu-tips");
if (panelMsg != "" && tips != null){
sessionStorage.setItem("waifu-text", 8); sessionStorage.setItem("waifu-text", 8);
const tips = document.getElementById("waifu-tips");
tips.innerHTML = text; tips.innerHTML = text;
tips.classList.add("waifu-tips-active"); tips.classList.add("waifu-tips-active");
messageTimer = setTimeout(() => { messageTimer = setTimeout(() => {