diff options
Diffstat (limited to 'youtube/comments.py')
-rw-r--r-- | youtube/comments.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube/comments.py b/youtube/comments.py index fc353f9..c19a70a 100644 --- a/youtube/comments.py +++ b/youtube/comments.py @@ -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 |