chore: refactor attribute naming. This is currently representing something closer to depth of extraction, and not redirects.

pull/12169/head
Adam Miller 7 months ago
parent 6cd95babef
commit 050b6c1f29

@ -1822,15 +1822,15 @@ class YoutubeDL:
result_type = ie_result.get('_type', 'video')
if result_type in ('url', 'url_transparent'):
if 'redirect_count' in extra_info:
extra_info['redirect_count'] = 1 + extra_info.get('redirect_count', 0)
if 'extraction_depth' in extra_info:
extra_info['extraction_depth'] = 1 + extra_info.get('extraction_depth', 0)
else:
extra_info['redirect_count'] = 0
extra_info['extraction_depth'] = 0
# TODO: make command line arg with large or infinite default
if extra_info['redirect_count'] >= 5:
if extra_info['extraction_depth'] >= 20:
raise ExtractorError(
f"Too many redirects for URL: {ie_result['url']}",
f"Too many hops for URL: {ie_result['url']}",
expected=True,
)

Loading…
Cancel
Save