aboutsummaryrefslogtreecommitdiffstats
path: root/youtube
diff options
context:
space:
mode:
Diffstat (limited to 'youtube')
-rw-r--r--youtube/yt_data_extract/watch_extraction.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube/yt_data_extract/watch_extraction.py b/youtube/yt_data_extract/watch_extraction.py
index 5aaa318..ca2da10 100644
--- a/youtube/yt_data_extract/watch_extraction.py
+++ b/youtube/yt_data_extract/watch_extraction.py
@@ -340,8 +340,12 @@ def _extract_formats(info, player_response):
yt_formats = streaming_data.get('formats', []) + streaming_data.get('adaptiveFormats', [])
info['formats'] = []
- info['hls_manifest_url'] = streaming_data.get('hlsManifestUrl')
- info['dash_manifest_url'] = streaming_data.get('dashManifestUrl')
+ # because we may retry the extract_formats with a different player_response
+ # so keep what we have
+ conservative_update(info, 'hls_manifest_url',
+ streaming_data.get('hlsManifestUrl'))
+ conservative_update(info, 'dash_manifest_url',
+ streaming_data.get('dash_manifest_url'))
for yt_fmt in yt_formats:
fmt = {}