aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2021-02-19 04:15:03 +0530
committerpukkandan <pukkandan@gmail.com>2021-02-19 04:15:25 +0530
commitba7bf12d89cfab0aa079191da6c2ae88d4689396 (patch)
treef9d0fc51b871651b285118be7a55cb195472d264
parentf983b87567ff063d4daca13772a8e37af990f472 (diff)
downloadhypervideo-pre-ba7bf12d89cfab0aa079191da6c2ae88d4689396.tar.lz
hypervideo-pre-ba7bf12d89cfab0aa079191da6c2ae88d4689396.tar.xz
hypervideo-pre-ba7bf12d89cfab0aa079191da6c2ae88d4689396.zip
[youtube] Fix for empty comment text (Closes #97)
-rw-r--r--youtube_dlc/extractor/youtube.py2
1 files changed, 1 insertions, 1 deletions
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 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
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'),