Skip to content

Commit

Permalink
2022.02
Browse files Browse the repository at this point in the history
1、修复隐藏看板娘后js报错;
2、使用显式浏览器获取抖音互动数据,解决抖音数据不稳定问题。
  • Loading branch information
xszyou committed Feb 7, 2023
1 parent 88ed698 commit 9067b05
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
14 changes: 0 additions & 14 deletions core/fay_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,20 +281,6 @@ def __auto_speak(self):
amount = interact.data["gifts"][i]["amount"]
msg += "{}送给我的{}个{}".format(user, amount, gift[1])
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.speaking = True
MyThread(target=self.__say, args=['interact']).start()
Expand Down
8 changes: 4 additions & 4 deletions core/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ def __init__(self, url):
def __start(self):
MyThread(target=self.__driver_alive_runnable).start()
self.chrome_options = Options()
self.chrome_options.add_argument('--headless')
self.chrome_options.add_argument('--blink-settings=imagesEnabled=false')
# self.chrome_options.add_argument('--headless')
# 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.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.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.__join_runnable).start()
MyThread(target=self.__interact_runnable).start()
MyThread(target=self.__follower_runnable).start()
# MyThread(target=self.__follower_runnable).start() #抖音加了验证码,暂时不获取粉丝数

def start(self):
MyThread(target=self.__start).start()
Expand Down
4 changes: 2 additions & 2 deletions gui/static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ new Vue({

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

0 comments on commit 9067b05

Please sign in to comment.