on master help sign in
Propagate error messages from YouTube API
commite158eeee4bf69b973659f68a799d5c005aa1c0ae authorNoémi Ványi <sitbackandwait@gmail.com> dateFri 9 Oct 2020, 17:34 (6 years ago) parent835d16c
1 file changed+3
searx/engines/youtube_api.py+3
searx/engines/youtube_api.py+3
@@ -47,6 +47,9 @@ def response(resp):
4747
4848 search_results = loads(resp.text)
4949
50+ if 'error' in search_results and 'message' in search_results['error']:
51+ raise Exception(search_results['error']['message'])
52+
5053 # return empty array if there are no results
5154 if 'items' not in search_results:
5255 return []