直播间弹幕爬虫
Python爬取websocket数据,直播间弹幕爬虫为例
- 输入直播间链接
- 输入爬取的弹幕类型
- 发送弹幕信息或其他信息到指定群聊

消息发送到目标群组
- 输入目标消息群组
- 自动将爬取的数据发送到群组或过滤数据后发送
ActionChains(web_obj).move_to_element(letter_btn).perform()
time.sleep(2)
groups=web_obj.find_elements_by_class_name('...')
for group_btn in groups:
if group_btn.text==send_group_name:
print(f'[{time.strftime("%Y-%m-%d %H:%M:%S")}] 找到聊天组: {send_group_name} ......')
group_btn.click()
time.sleep(3)
return
密钥生成
- 自定义密钥数据:用户名+到期时间
- 配合其他程序联合使用,定时用户到期
key = ""
username=input('请输入用户id: ')
time=input('请输入到期时间: 格式(2023-07-26)')
strData = dict(username=username,time=time)
.......
file=open('key.txt','w')
file.write(encData)
file.close()
密钥读取
key=""
file=open('key.txt','r')
file_ctx=file.readlines()[0]
crypt_sm4 = sm4.CryptSM4()
.....
decData=decrypt_value.decode()
详细代码私信我