danmaku_tools icon indicating copy to clipboard operation
danmaku_tools copied to clipboard

danmaku_energy_map 模块在处理空弹幕时报错

Open Shiori514 opened this issue 2 years ago • 2 comments

弹幕如下,录播姬版本2.2.0

<d p="1387.857,1,25,5566168,1661817077854,0,5819065,0" user="黎曦暗夜" raw="[[0,1,25,5566168,1661817077854,1661817078,0,&quot;65b84690&quot;,0,0,0,&quot;&quot;,0,&quot;{}&quot;,&quot;{}&quot;,{&quot;mode&quot;:0,&quot;show_player_type&quot;:0,&quot;extra&quot;:&quot;{\&quot;send_from_me\&quot;:false,\&quot;mode\&quot;:0,\&quot;color\&quot;:5566168,\&quot;dm_type\&quot;:0,\&quot;font_size\&quot;:25,\&quot;player_mode\&quot;:1,\&quot;show_player_type\&quot;:0,\&quot;content\&quot;:\&quot; \&quot;,\&quot;user_hash\&quot;:\&quot;1706575504\&quot;,\&quot;emoticon_unique\&quot;:\&quot;\&quot;,\&quot;bulge_display\&quot;:0,\&quot;recommend_score\&quot;:10,\&quot;main_state_dm_color\&quot;:\&quot;\&quot;,\&quot;objective_state_dm_color\&quot;:\&quot;\&quot;,\&quot;direction\&quot;:0,\&quot;pk_direction\&quot;:0,\&quot;quartet_direction\&quot;:0,\&quot;anniversary_crowd\&quot;:0,\&quot;yeah_space_type\&quot;:\&quot;\&quot;,\&quot;yeah_space_url\&quot;:\&quot;\&quot;,\&quot;jump_to_url\&quot;:\&quot;\&quot;,\&quot;space_type\&quot;:\&quot;\&quot;,\&quot;space_url\&quot;:\&quot;\&quot;}&quot;},{&quot;activity_identity&quot;:&quot;&quot;,&quot;activity_source&quot;:0,&quot;not_show&quot;:0}],&quot; &quot;,[5819065,&quot;黎曦暗夜&quot;,0,0,0,10000,1,&quot;&quot;],[14,&quot;协力者&quot;,&quot;账号已注销&quot;,21249896,12478086,&quot;&quot;,0,12478086,12478086,12478086,0,1,399817053],[42,0,16746162,26874,0],[&quot;&quot;,&quot;&quot;],0,0,null,{&quot;ts&quot;:1661817077,&quot;ct&quot;:&quot;BB6CECAF&quot;},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

Shiori514 avatar Aug 30 '22 07:08 Shiori514

这和 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,&quot;16c6cc94&quot;,0,0,0,&quot;&quot;,0,&quot;{}&quot;,&quot;{}&quot;,{&quot;mode&quot;:0,&quot;show_player_type&quot;:0,&quot;extra&quot;:&quot;{\&quot;send_from_me\&quot;:false,\&quot;mode\&quot;:0,\&quot;color\&quot;:5566168,\&quot;dm_type\&quot;:0,\&quot;font_size\&quot;:25,\&quot;player_mode\&quot;:1,\&quot;show_player_type\&quot;:0,\&quot;content\&quot;:\&quot; \&quot;,\&quot;user_hash\&quot;:\&quot;382127252\&quot;,\&quot;emoticon_unique\&quot;:\&quot;\&quot;,\&quot;bulge_display\&quot;:0,\&quot;direction\&quot;:0,\&quot;pk_direction\&quot;:0,\&quot;quartet_direction\&quot;:0,\&quot;yeah_space_type\&quot;:\&quot;\&quot;,\&quot;yeah_space_url\&quot;:\&quot;\&quot;,\&quot;jump_to_url\&quot;:\&quot;\&quot;,\&quot;space_type\&quot;:\&quot;\&quot;,\&quot;space_url\&quot;:\&quot;\&quot;}&quot;}],&quot; &quot;,[190342123,&quot;山城子-&quot;,0,0,0,10000,1,&quot;&quot;],[11,&quot;老头乐&quot;,&quot;小深深儿&quot;,2807295,9272486,&quot;&quot;,0,9272486,9272486,9272486,0,1,10673533],[15,0,6406234,&quot;&gt;50000&quot;,0],[&quot;&quot;,&quot;&quot;],0,0,null,{&quot;ts&quot;:1647350360,&quot;ct&quot;:&quot;63E36247&quot;},0,0,null,null,0,49]" />

Shiori514 avatar Aug 30 '22 07:08 Shiori514

借楼,我这里也出现了相同问题,高能功能报错导致后续功能全部不可用

Decretum-Wu avatar Sep 07 '22 11:09 Decretum-Wu

请问这个问题解决了吗? 我也遇到了同样的问题

ChenFu0420 avatar Jan 14 '23 14:01 ChenFu0420

在这个 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: @.***>

Shiori514 avatar Jan 14 '23 14:01 Shiori514

尝试了一下好像还是不可以,弹幕文件我上传一下。本人能力有限,希望有时间有人能分析一下是什么原因导致的。 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: @.>

ChenFu0420 avatar Jan 14 '23 15:01 ChenFu0420

我试了一下是可以生成的,你那边应该是没更新,可以用 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: @.***>

Shiori514 avatar Jan 14 '23 15:01 Shiori514

我试了一下是可以生成的,你那边应该是没更新,可以用 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那个脚本会调用这个程序吧,我也遇到这个问题了

yhz-git avatar Jan 14 '23 15:01 yhz-git

经过测试已经可以正常处理了,非常感谢您的帮助。

ChenFu0420 avatar Jan 14 '23 16:01 ChenFu0420

你可以在容器内运行我上面写的那行更新到新版本,用 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: @.***>

Shiori514 avatar Jan 14 '23 16:01 Shiori514

你可以在容器内运行我上面写的那行更新到新版本,用 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: @.***>

image 试了下,我这个报错好像不太一样

yhz-git avatar Jan 14 '23 17:01 yhz-git

可以发个弹幕样本吗

valkjsaaa avatar Jan 15 '23 00:01 valkjsaaa

你再开个 issue 吧,我先把这个关了因为已经改了

valkjsaaa avatar Jan 16 '23 08:01 valkjsaaa