Skip to content

Commit

Permalink
快手 追加礼物Id和连击数日志,礼物价格和礼物名有待后期维护礼物表;补充默认cookie文件夹
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Aug 4, 2023
1 parent 01a3947 commit 4e35f03
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,5 @@ test.py

# debug输出
tmp/

cookie/*.json
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,7 @@ cmd输入命令即可:`doctoc /path/to/file`

### 2023-08-04
- 更换快手监听方案,新方案是playwright的形式,建议使用小号,每次用完需要删除cookie下的json文件,因为第二次就异常了,没法正常捕获。暂时只支持弹幕回复。
- 快手 追加礼物Id和连击数日志,礼物价格和礼物名有待后期维护礼物表;补充默认cookie文件夹

</details>

Expand Down
1 change: 1 addition & 0 deletions cookie/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
此处存放快手的cookie文件,因为监听服务被噶噶检测,所以每次用完后,第二次使用时需要删除json文件,重新创建。
6 changes: 4 additions & 2 deletions ks.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ def handler(self, websocket):
msg_list = obj.get('giftFeeds', '')
for i in msg_list:
username = i['user']['userName']
pid = i['user']['principalId']
logging.info(f"[🎁直播间礼物消息] {username} {pid}")
# pid = i['user']['principalId']
giftId = i['giftId']
comboCount = i['comboCount']
logging.info(f"[🎁直播间礼物消息] 用户:{username} 赠送礼物Id={giftId} 连击数={comboCount}")
if obj.get('likeFeeds', ''):
msg_list = obj.get('likeFeeds', '')
for i in msg_list:
Expand Down

0 comments on commit 4e35f03

Please sign in to comment.