comments: filter out invalid fields; only timestamp should be integer

"{str_or_none}" vs. "{str}"

Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
This commit is contained in:
Mozi 2024-05-05 17:05:00 +00:00
parent 074e96c746
commit 5bbd6c18b8
1 changed files with 5 additions and 5 deletions

View File

@ -64,11 +64,11 @@ class MixchIE(InfoExtractor):
yield from traverse_obj(self._download_json(
f'https://mixch.tv/api-web/lives/{video_id}/messages', video_id,
note='Downloading comments', errnote='Failed to download comments'), (..., {
'author': ('name', {str_or_none}),
'author_id': ('user_id', {int_or_none}),
'id': ('message_id', {str_or_none}),
'text': ('body', {str_or_none}),
'timestamp': ('created', {int_or_none}),
'author': ('name', {str}),
'author_id': ('user_id', {str_or_none}),
'id': ('message_id', {str}, {lambda x: x or None}),
'text': ('body', {str}),
'timestamp': ('created', {int}),
}))