wbt5 / real-url

获取斗鱼&虎牙&哔哩哔哩&抖音&快手等 58 个直播平台的真实流媒体地址(直播源)和弹幕,直播源可在 PotPlayer、flv.js 等播放器中播放。
GNU General Public License v2.0
7.31k stars 1.54k forks source link

B站弹幕获取报错 #377

Open Diversitylin opened 2 years ago

Diversitylin commented 2 years ago

大佬您好, 感谢开源分享代码。我现在用你的包获取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>

BUGMojang commented 2 years ago

你的直播间地址不对吧 live.bilibil.com后面应该跟的是数字

BUGMojang commented 2 years ago

你的直播间地址不对吧 live.bilibil.com后面应该跟的是数字

举例 live.bilibili.com/650

Diversitylin commented 1 year ago

多谢指出已经解决。

smallwhitedesu1 commented 1 year ago

多谢美国解答。

你还能获取到直播源吗