From 4ba001080fc39c121186f7a799dbe0c87b1906a8 Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Fri, 11 Jun 2021 09:12:56 +1200 Subject: [PATCH] [youtube] Non-fatal alert reporting for unavailable videos page (#401) Co-Authored by: colethedj, pukkandan --- yt_dlp/extractor/youtube.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index f88c2f727..9161ea3d1 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -3602,7 +3602,13 @@ def _extract_response(self, item_id, query, note='Downloading API JSON', headers else: # Youtube may send alerts if there was an issue with the continuation page - self._extract_and_report_alerts(response, expected=False) + try: + self._extract_and_report_alerts(response, expected=False) + except ExtractorError as e: + if fatal: + raise + self.report_warning(error_to_compat_str(e)) + return if not check_get_keys or dict_get(response, check_get_keys): break # Youtube sometimes sends incomplete data