From 56049aa4a9aeeabdd4e8736b9c814916019e6e85 Mon Sep 17 00:00:00 2001 From: dtlnor Date: Mon, 26 Sep 2022 02:54:41 +0900 Subject: [PATCH] support new message type there is "headerSubtext": {"simpleText": "some_msg"} now --- danmaku/youtube-live-chat-danmaku-ass.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/danmaku/youtube-live-chat-danmaku-ass.py b/danmaku/youtube-live-chat-danmaku-ass.py index bb62377..e083537 100755 --- a/danmaku/youtube-live-chat-danmaku-ass.py +++ b/danmaku/youtube-live-chat-danmaku-ass.py @@ -412,7 +412,13 @@ def map_run(run): elif best_thumbnail['width'] < thumbnail['width']: best_thumbnail = thumbnail return chr(int(self._custom_emoji_mapper.get_mapping(best_thumbnail['url']))) - return ''.join(map(map_run, data['runs'])) + if 'runs' in data: + return ''.join(map(map_run, data['runs'])) + elif 'simpleText' in data: + return data['simpleText'] + else: + raise Exception("Non-implemented renderer_message type {}".format(data)) + def _parse_badge_types(self, data): badge_types = set()