From ba7bf12d89cfab0aa079191da6c2ae88d4689396 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 19 Feb 2021 04:15:03 +0530 Subject: [PATCH] [youtube] Fix for empty comment text (Closes #97) --- youtube_dlc/extractor/youtube.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py index 5ff4c42a2..b2b02f5e2 100644 --- a/youtube_dlc/extractor/youtube.py +++ b/youtube_dlc/extractor/youtube.py @@ -2078,7 +2078,7 @@ def get_continuation(continuation, session_token, replies=False): comment = meta_comment['commentThreadRenderer']['comment']['commentRenderer'] video_comments.append({ 'id': comment['commentId'], - 'text': ''.join([c['text'] for c in comment['contentText']['runs']]), + 'text': ''.join([c['text'] for c in try_get(comment, lambda x: x['contentText']['runs'], list) or []]), 'time_text': ''.join([c['text'] for c in comment['publishedTimeText']['runs']]), 'author': comment.get('authorText', {}).get('simpleText', ''), 'votes': comment.get('voteCount', {}).get('simpleText', '0'),