aboutsummaryrefslogtreecommitdiffstats
path: root/youtube
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2020-12-21 12:25:44 -0800
committerJesús <heckyel@hyperbola.info>2020-12-21 21:16:28 -0500
commite41180058f8d812d8d3c59e15f2e7d7b84eef808 (patch)
tree50464ad88a47f44ae40772b4f2bab0aa1cd46f8b /youtube
parentce146b32b1626947e4d18d994803b18c2edd89ef (diff)
downloadyt-local-e41180058f8d812d8d3c59e15f2e7d7b84eef808.tar.lz
yt-local-e41180058f8d812d8d3c59e15f2e7d7b84eef808.tar.xz
yt-local-e41180058f8d812d8d3c59e15f2e7d7b84eef808.zip
Fix exception when video comments disabled and blank comments info
e.g. happens on vid where comments are disabled if comments disabled in settings since the comments info object is just {} Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'youtube')
-rw-r--r--youtube/watch.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube/watch.py b/youtube/watch.py
index 7c140d9..78a404a 100644
--- a/youtube/watch.py
+++ b/youtube/watch.py
@@ -458,7 +458,7 @@ def get_watch_page(video_id=None):
# Check for false determination of disabled comments, which comes from
# the watch page. But if we got comments in the separate request for those,
# then the determination is wrong.
- if info['comments_disabled'] and len(comments_info['comments']) != 0:
+ if info['comments_disabled'] and comments_info.get('comments'):
info['comments_disabled'] = False
print('Warning: False determination that comments are disabled')
print('Comment count:', info['comment_count'])