danmaku_tools
danmaku_tools copied to clipboard
danmaku_energy_map 模块在处理空弹幕时报错
弹幕如下,录播姬版本2.2.0
<d p="1387.857,1,25,5566168,1661817077854,0,5819065,0" user="黎曦暗夜" raw="[[0,1,25,5566168,1661817077854,1661817078,0,"65b84690",0,0,0,"",0,"{}","{}",{"mode":0,"show_player_type":0,"extra":"{\"send_from_me\":false,\"mode\":0,\"color\":5566168,\"dm_type\":0,\"font_size\":25,\"player_mode\":1,\"show_player_type\":0,\"content\":\" \",\"user_hash\":\"1706575504\",\"emoticon_unique\":\"\",\"bulge_display\":0,\"recommend_score\":10,\"main_state_dm_color\":\"\",\"objective_state_dm_color\":\"\",\"direction\":0,\"pk_direction\":0,\"quartet_direction\":0,\"anniversary_crowd\":0,\"yeah_space_type\":\"\",\"yeah_space_url\":\"\",\"jump_to_url\":\"\",\"space_type\":\"\",\"space_url\":\"\"}"},{"activity_identity":"","activity_source":0,"not_show":0}]," ",[5819065,"黎曦暗夜",0,0,0,10000,1,""],[14,"协力者","账号已注销",21249896,12478086,"",0,12478086,12478086,12478086,0,1,399817053],[42,0,16746162,26874,0],["",""],0,0,null,{"ts":1661817077,"ct":"BB6CECAF"},0,0,null,null,0,42]" />
这条弹幕经处理后在数组中为 None 类型,报错为
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.8/dist-packages/danmaku_tools/danmaku_energy_map.py", line 503, in <module>
wordcount_slices = gen_slice_wordcount(slices)
File "/usr/local/lib/python3.8/dist-packages/danmaku_tools/danmaku_energy_map.py", line 91, in gen_slice_wordcount
return [Counter(jieba.cut(" ".join(slice))) for slice in danmaku_slices]
File "/usr/local/lib/python3.8/dist-packages/danmaku_tools/danmaku_energy_map.py", line 91, in <listcomp>
return [Counter(jieba.cut(" ".join(slice))) for slice in danmaku_slices]
TypeError: sequence item 2: expected str instance, NoneType found
这和 valkjsaaa/auto-bilibili-recorder#17 是同一个问题,在那条 issue 附上的弹幕第3180行出现了一条空弹幕
<d p="2394.897,1,25,5566168,1647350360211,0,190342123,0" user="山城子-" raw="[[0,1,25,5566168,1647350360211,1647350360,0,"16c6cc94",0,0,0,"",0,"{}","{}",{"mode":0,"show_player_type":0,"extra":"{\"send_from_me\":false,\"mode\":0,\"color\":5566168,\"dm_type\":0,\"font_size\":25,\"player_mode\":1,\"show_player_type\":0,\"content\":\" \",\"user_hash\":\"382127252\",\"emoticon_unique\":\"\",\"bulge_display\":0,\"direction\":0,\"pk_direction\":0,\"quartet_direction\":0,\"yeah_space_type\":\"\",\"yeah_space_url\":\"\",\"jump_to_url\":\"\",\"space_type\":\"\",\"space_url\":\"\"}"}]," ",[190342123,"山城子-",0,0,0,10000,1,""],[11,"老头乐","小深深儿",2807295,9272486,"",0,9272486,9272486,9272486,0,1,10673533],[15,0,6406234,">50000",0],["",""],0,0,null,{"ts":1647350360,"ct":"63E36247"},0,0,null,null,0,49]" />
借楼,我这里也出现了相同问题,高能功能报错导致后续功能全部不可用
请问这个问题解决了吗? 我也遇到了同样的问题
在这个 commit 里应该已经修复了,看看你的版本对不对, https://github.com/valkjsaaa/danmaku_tools/commit/0c07ab48b21abf76ff27737cabeecdf205d593ce
ChenFu0420 @.***> 于2023年1月14日周六 22:23写道:
请问这个问题解决了吗? 我也遇到了同样的问题
— Reply to this email directly, view it on GitHub https://github.com/valkjsaaa/danmaku_tools/issues/7#issuecomment-1382752720, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y . You are receiving this because you authored the thread.Message ID: @.***>
尝试了一下好像还是不可以,弹幕文件我上传一下。本人能力有限,希望有时间有人能分析一下是什么原因导致的。 169669-20230113-195225-726.all.xml.zip
在这个 commit 里应该已经修复了,看看你的版本对不对, 0c07ab4 ChenFu0420 @.> 于2023年1月14日周六 22:23写道: … 请问这个问题解决了吗? 我也遇到了同样的问题 — Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y . You are receiving this because you authored the thread.Message ID: @.>
我试了一下是可以生成的,你那边应该是没更新,可以用 pip3 install git+https://github.com/valkjsaaa/danmaku_tools.git@0c07ab48b21abf76ff27737cabeecdf205d593ce 安装修复后的版本
ChenFu0420 @.***> 于2023年1月14日周六 23:36写道:
尝试了一下好像还是不可以,弹幕文件我上传一下。本人能力有限,希望有时间有人能分析一下是什么原因导致的。 169669-20230113-195225-726.all.xml.zip https://github.com/valkjsaaa/danmaku_tools/files/10418051/169669-20230113-195225-726.all.xml.zip
在这个 commit 里应该已经修复了,看看你的版本对不对, 0c07ab4 https://github.com/valkjsaaa/danmaku_tools/commit/0c07ab48b21abf76ff27737cabeecdf205d593ce ChenFu0420 @.
> 于2023年1月14日周六 22:23写道: … <#m_-8224688668561668166_> 请问这个问题解决了吗? 我也遇到了同样的问题 — Reply to this email directly, view it on GitHub <#7 (comment) https://github.com/valkjsaaa/danmaku_tools/issues/7#issuecomment-1382752720>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y . You are receiving this because you authored the thread.Message ID: @.>
— Reply to this email directly, view it on GitHub https://github.com/valkjsaaa/danmaku_tools/issues/7#issuecomment-1382824306, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSV7A53HW5JYZZZOIID5E3WSLBYTANCNFSM6AAAAAAQADGH6Y . You are receiving this because you authored the thread.Message ID: @.***>
我试了一下是可以生成的,你那边应该是没更新,可以用 pip3 install git+https://github.com/valkjsaaa/danmaku_tools.git@0c07ab48b21abf76ff27737cabeecdf205d593ce 安装修复后的版本 ChenFu0420 @.> 于2023年1月14日周六 23:36写道: … 尝试了一下好像还是不可以,弹幕文件我上传一下。本人能力有限,希望有时间有人能分析一下是什么原因导致的。 169669-20230113-195225-726.all.xml.zip https://github.com/valkjsaaa/danmaku_tools/files/10418051/169669-20230113-195225-726.all.xml.zip 在这个 commit 里应该已经修复了,看看你的版本对不对, 0c07ab4 <0c07ab4> ChenFu0420 @. > 于2023年1月14日周六 22:23写道: … <#m_-8224688668561668166_> 请问这个问题解决了吗? 我也遇到了同样的问题 — Reply to this email directly, view it on GitHub <#7 (comment) <#7 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y . You are receiving this because you authored the thread.Message ID: @.> — Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSV7A53HW5JYZZZOIID5E3WSLBYTANCNFSM6AAAAAAQADGH6Y . You are receiving this because you authored the thread.Message ID: @.>
auto-bilibili-recorder那个脚本会调用这个程序吧,我也遇到这个问题了
经过测试已经可以正常处理了,非常感谢您的帮助。
你可以在容器内运行我上面写的那行更新到新版本,用 docker exec -it <容器id> bash 进入容器
yhz-git @.***> 于2023年1月14日周六 23:57写道:
我试了一下是可以生成的,你那边应该是没更新,可以用 pip3 install git+ @.*** 安装修复后的版本 ChenFu0420 @.
> 于2023年1月14日周六 23:36写道: … <#m_-8791726547751313198_> 尝试了一下好像还是不可以,弹幕文件我上传一下。本人能力有限,希望有时间有人能分析一下是什么原因导致的。 169669-20230113-195225-726.all.xml.zip https://github.com/valkjsaaa/danmaku_tools/files/10418051/169669-20230113-195225-726.all.xml.zip https://github.com/valkjsaaa/danmaku_tools/files/10418051/169669-20230113-195225-726.all.xml.zip 在这个 commit 里应该已经修复了,看看你的版本对不对, 0c07ab4 https://github.com/valkjsaaa/danmaku_tools/commit/0c07ab48b21abf76ff27737cabeecdf205d593ce <0c07ab4 https://github.com/valkjsaaa/danmaku_tools/commit/0c07ab48b21abf76ff27737cabeecdf205d593ce> ChenFu0420 @. > 于2023年1月14日周六 22:23写道: … <#m_-8224688668561668166_> 请问这个问题解决了吗? 我也遇到了同样的问题 — Reply to this email directly, view it on GitHub <#7 https://github.com/valkjsaaa/danmaku_tools/issues/7 (comment) <#7 (comment) https://github.com/valkjsaaa/danmaku_tools/issues/7#issuecomment-1382752720>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y . You are receiving this because you authored the thread.Message ID: @.> — Reply to this email directly, view it on GitHub <#7 (comment) https://github.com/valkjsaaa/danmaku_tools/issues/7#issuecomment-1382824306>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSV7A53HW5JYZZZOIID5E3WSLBYTANCNFSM6AAAAAAQADGH6Y https://github.com/notifications/unsubscribe-auth/AMSV7A53HW5JYZZZOIID5E3WSLBYTANCNFSM6AAAAAAQADGH6Y . You are receiving this because you authored the thread.Message ID: @.>
auto-bilibili-recorder那个脚本会调用这个程序吧,我也遇到这个问题了
— Reply to this email directly, view it on GitHub https://github.com/valkjsaaa/danmaku_tools/issues/7#issuecomment-1382829636, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSV7AZDYSXEYKKMYW5WA33WSLEFXANCNFSM6AAAAAAQADGH6Y . You are receiving this because you authored the thread.Message ID: @.***>
你可以在容器内运行我上面写的那行更新到新版本,用 docker exec -it <容器id> bash 进入容器 yhz-git @.> 于2023年1月14日周六 23:57写道: … 我试了一下是可以生成的,你那边应该是没更新,可以用 pip3 install git+ @. 安装修复后的版本 ChenFu0420 @. > 于2023年1月14日周六 23:36写道: … <#m_-8791726547751313198_> 尝试了一下好像还是不可以,弹幕文件我上传一下。本人能力有限,希望有时间有人能分析一下是什么原因导致的。 169669-20230113-195225-726.all.xml.zip https://github.com/valkjsaaa/danmaku_tools/files/10418051/169669-20230113-195225-726.all.xml.zip https://github.com/valkjsaaa/danmaku_tools/files/10418051/169669-20230113-195225-726.all.xml.zip 在这个 commit 里应该已经修复了,看看你的版本对不对, 0c07ab4 <0c07ab4> <0c07ab4 <0c07ab4>> ChenFu0420 @. > 于2023年1月14日周六 22:23写道: … <#m_-8224688668561668166_> 请问这个问题解决了吗? 我也遇到了同样的问题 — Reply to this email directly, view it on GitHub <#7 <#7> (comment) <#7 (comment) <#7 (comment)>>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y https://github.com/notifications/unsubscribe-auth/AMSV7AYRQLP6JOGWFTFDSK3WSKZGLANCNFSM6AAAAAAQADGH6Y . You are receiving this because you authored the thread.Message ID: @.> — Reply to this email directly, view it on GitHub <#7 (comment) <#7 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSV7A53HW5JYZZZOIID5E3WSLBYTANCNFSM6AAAAAAQADGH6Y https://github.com/notifications/unsubscribe-auth/AMSV7A53HW5JYZZZOIID5E3WSLBYTANCNFSM6AAAAAAQADGH6Y . You are receiving this because you authored the thread.Message ID: @.> auto-bilibili-recorder那个脚本会调用这个程序吧,我也遇到这个问题了 — Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSV7AZDYSXEYKKMYW5WA33WSLEFXANCNFSM6AAAAAAQADGH6Y . You are receiving this because you authored the thread.Message ID: @.***>
试了下,我这个报错好像不太一样
可以发个弹幕样本吗
你再开个 issue 吧,我先把这个关了因为已经改了