diff options
author | James Taylor <user234683@users.noreply.github.com> | 2020-12-21 12:25:44 -0800 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-12-21 21:16:28 -0500 |
commit | e41180058f8d812d8d3c59e15f2e7d7b84eef808 (patch) | |
tree | 50464ad88a47f44ae40772b4f2bab0aa1cd46f8b | |
parent | ce146b32b1626947e4d18d994803b18c2edd89ef (diff) | |
download | yt-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>
-rw-r--r-- | youtube/watch.py | 2 |
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']) |