From 3ce2933693b66e5e8948352609c8258d8d2cec15 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Tue, 16 Aug 2022 22:01:48 +0530 Subject: [PATCH] [youtube] Fix error reporting of "Incomplete data" Related: #4669 --- yt_dlp/extractor/youtube.py | 2 +- yt_dlp/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 4f279b36d7..12634483e6 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -809,7 +809,7 @@ def _extract_response(self, item_id, query, note='Downloading API JSON', headers # Youtube sometimes sends incomplete data # See: https://github.com/ytdl-org/youtube-dl/issues/28194 if not traverse_obj(response, *variadic(check_get_keys)): - retry.error = ExtractorError('Incomplete data received') + retry.error = ExtractorError('Incomplete data received', expected=True) continue return response diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index db355ec92a..49ee228650 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -5764,7 +5764,7 @@ def report_retry(e, count, retries, *, sleep_func, info, warn, error=None, suffi if not count: return warn(e) elif isinstance(e, ExtractorError): - e = remove_end(str(e.cause) or e.orig_msg, '.') + e = remove_end(str_or_none(e.cause) or e.orig_msg, '.') warn(f'{e}. Retrying{format_field(suffix, None, " %s")} ({count}/{retries})...') delay = float_or_none(sleep_func(n=count - 1)) if callable(sleep_func) else sleep_func