video_comments: print error string in console

Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
James Taylor 2020-12-21 12:44:00 -08:00 committed by Jesús
parent e41180058f
commit 84c6192e08
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -179,7 +179,6 @@ def video_comments(video_id, sort=0, offset=0, lc='', secret_key=''):
else:
return {}
except util.FetchError as e:
print('Error retrieving comments for ' + str(video_id))
if e.code == '429' and settings.route_tor:
comments_info['error'] = 'Error: Youtube blocked the request because the Tor exit node is overutilized.'
if e.error_message:
@ -189,9 +188,12 @@ def video_comments(video_id, sort=0, offset=0, lc='', secret_key=''):
comments_info['error'] = traceback.format_exc()
except Exception as e:
print('Error retrieving comments for ' + str(video_id))
comments_info['error'] = traceback.format_exc()
if comments_info.get('error'):
print('Error retrieving comments for ' + str(video_id) + ':\n' +
comments_info['error'])
return comments_info