mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-03-09 12:50:23 -05:00
chore: refactor attribute naming. This is currently representing something closer to depth of extraction, and not redirects.
This commit is contained in:
parent
6cd95babef
commit
050b6c1f29
1 changed files with 5 additions and 5 deletions
|
@ -1822,15 +1822,15 @@ def process_ie_result(self, ie_result, download=True, extra_info=None):
|
||||||
result_type = ie_result.get('_type', 'video')
|
result_type = ie_result.get('_type', 'video')
|
||||||
|
|
||||||
if result_type in ('url', 'url_transparent'):
|
if result_type in ('url', 'url_transparent'):
|
||||||
if 'redirect_count' in extra_info:
|
if 'extraction_depth' in extra_info:
|
||||||
extra_info['redirect_count'] = 1 + extra_info.get('redirect_count', 0)
|
extra_info['extraction_depth'] = 1 + extra_info.get('extraction_depth', 0)
|
||||||
else:
|
else:
|
||||||
extra_info['redirect_count'] = 0
|
extra_info['extraction_depth'] = 0
|
||||||
|
|
||||||
# TODO: make command line arg with large or infinite default
|
# TODO: make command line arg with large or infinite default
|
||||||
if extra_info['redirect_count'] >= 5:
|
if extra_info['extraction_depth'] >= 20:
|
||||||
raise ExtractorError(
|
raise ExtractorError(
|
||||||
f"Too many redirects for URL: {ie_result['url']}",
|
f"Too many hops for URL: {ie_result['url']}",
|
||||||
expected=True,
|
expected=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue