video_comments: print error string in console
Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
parent
e41180058f
commit
84c6192e08
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user