大佬您好,
感谢开源分享代码。我现在用你的包获取B站直播弹幕,我安装了需要的包,运行main.py之后输入直播间地址但是报错,可否帮忙看一下。报错如下
PS E:\LinLib\others\实用程序_弹幕抓取\Example\real-url-master\danmu> python .\main.py
请输入直播间地址:
https://live.bilibili.com/?spm_id_from=333.1007.0.0
Traceback (most recent call last):
File ".\main.py", line 24, in
asyncio.run(main(a))
File "C:\ProgramData\Anaconda3\lib\asyncio\runners.py", line 43, in run
return loop.run_until_complete(main)
File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File ".\main.py", line 20, in main
await dmc.start()
File "E:\LinLib\others\实用程序_弹幕抓取\Example\real-url-master\danmu\danmaku_init_.py", line 224, in start
await self.init_ws()
File "E:\LinLib\others\实用程序_弹幕抓取\Example\real-url-master\danmu\danmaku_init_.py", line 71, in init_ws
ws_url, reg_datas = await self.__site.get_ws_info(self.__url)
File "E:\LinLib\others\实用程序_弹幕抓取\Example\real-url-master\danmu\danmaku\bilibili.py", line 21, in get_ws_info
room_id = room_json['data']['room_id']
TypeError: list indices must be integers or slices, not str
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x000001FCD26D58B0>
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\asyncio\proactor_events.py", line 116, in del
self.close()
File "C:\ProgramData\Anaconda3\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 719, in call_soon
self._check_closed()
File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 508, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001FCD485C460>
你的直播间地址不对吧
live.bilibil.com后面应该跟的是数字
你的直播间地址不对吧
live.bilibil.com后面应该跟的是数字
举例
live.bilibili.com/650