]> jfr.im git - yt-dlp.git/commitdiff
[youtube] Fix for empty comment text (Closes #97)
authorpukkandan <redacted>
Thu, 18 Feb 2021 22:45:03 +0000 (04:15 +0530)
committerpukkandan <redacted>
Thu, 18 Feb 2021 22:45:25 +0000 (04:15 +0530)
youtube_dlc/extractor/youtube.py

index 5ff4c42a2d309a34abc5a93c040c9ec978775626..b2b02f5e2b89a3e4a27f58133f738a6f8904a323 100644 (file)
@@ -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'),