From 5bbd6c18b8a01e2f8966e8f4d586b6ffd4f689ae Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Sun, 5 May 2024 17:05:00 +0000 Subject: [PATCH] comments: filter out invalid fields; only timestamp should be integer "{str_or_none}" vs. "{str}" Co-authored-by: pukkandan --- yt_dlp/extractor/mixch.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yt_dlp/extractor/mixch.py b/yt_dlp/extractor/mixch.py index b6f7d363c..cc7968da5 100644 --- a/yt_dlp/extractor/mixch.py +++ b/yt_dlp/extractor/mixch.py @@ -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}), }))