|
|
@ -1822,15 +1822,15 @@ class YoutubeDL:
|
|
|
|
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,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|