diff options
author | Noémi Ványi <sitbackandwait@gmail.com> | 2020-10-09 17:34:26 +0200 |
---|---|---|
committer | Noémi Ványi <sitbackandwait@gmail.com> | 2020-10-09 17:34:26 +0200 |
commit | e158eeee4bf69b973659f68a799d5c005aa1c0ae (patch) | |
tree | 92127a185b498c845e2e8cee7a8d06923e5cc022 | |
parent | 835d16cbb1f896859f1757c1d952974520ec88a8 (diff) | |
download | searxng-e158eeee4bf69b973659f68a799d5c005aa1c0ae.tar.gz searxng-e158eeee4bf69b973659f68a799d5c005aa1c0ae.zip |
Propagate error messages from YouTube API
-rw-r--r-- | searx/engines/youtube_api.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/searx/engines/youtube_api.py b/searx/engines/youtube_api.py index 2542169a6..4a205ed6c 100644 --- a/searx/engines/youtube_api.py +++ b/searx/engines/youtube_api.py @@ -47,6 +47,9 @@ def response(resp): search_results = loads(resp.text) + if 'error' in search_results and 'message' in search_results['error']: + raise Exception(search_results['error']['message']) + # return empty array if there are no results if 'items' not in search_results: return [] |