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>
This commit is contained in:
James Taylor 2020-12-21 12:25:44 -08:00 committed by Jesús
parent ce146b32b1
commit e41180058f
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -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'])