Skip to content

Commit

Permalink
[youtube] Fix error reporting of "Incomplete data"
Browse files Browse the repository at this point in the history
Related: #4669
  • Loading branch information
pukkandan committed Aug 16, 2022
1 parent c200096 commit 3ce2933
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion yt_dlp/extractor/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion yt_dlp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3ce2933

Please sign in to comment.