diff options
author | James Taylor <user234683@users.noreply.github.com> | 2020-12-21 12:44:00 -0800 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-12-21 21:17:47 -0500 |
commit | 84c6192e08617c166065bbc6b91ecb7f9217f5e2 (patch) | |
tree | 91c7a9a55836b30c16ba9e2dcb75d4ce2b0f411e | |
parent | e41180058f8d812d8d3c59e15f2e7d7b84eef808 (diff) | |
download | yt-local-84c6192e08617c166065bbc6b91ecb7f9217f5e2.tar.lz yt-local-84c6192e08617c166065bbc6b91ecb7f9217f5e2.tar.xz yt-local-84c6192e08617c166065bbc6b91ecb7f9217f5e2.zip |
video_comments: print error string in console
Signed-off-by: Jesús <heckyel@hyperbola.info>
-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 |