From b53fc11b379b664ecdc486e60aea5876480c142b Mon Sep 17 00:00:00 2001 From: uohlhv Date: Sat, 13 Nov 2021 09:49:53 +0800 Subject: [PATCH] Fix errors occured when the attribute 'no' doesn't exist --- danmaku2ass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/danmaku2ass.py b/danmaku2ass.py index 4e8d1e0..4b6563c 100755 --- a/danmaku2ass.py +++ b/danmaku2ass.py @@ -144,7 +144,7 @@ def ReadCommentsNiconico(f, fontsize): size = fontsize * 0.64 elif mailstyle in NiconicoColorMap: color = NiconicoColorMap[mailstyle] - yield (max(int(comment.getAttribute('vpos')), 0) * 0.01, int(comment.getAttribute('date')), int(comment.getAttribute('no')), c, pos, color, size, (c.count('\n') + 1) * size, CalculateLength(c) * size) + yield (max(int(comment.getAttribute('vpos')), 0) * 0.01, int(comment.getAttribute('date')), 0, c, pos, color, size, (c.count('\n') + 1) * size, CalculateLength(c) * size) except (AssertionError, AttributeError, IndexError, TypeError, ValueError): logging.warning(_('Invalid comment: %s') % comment.toxml()) continue