Fix hls_manifest_url not included when there's no other formats

Since there are no formats, it was retrying with the
non-embedded playerResponse, which resulted in the
hls_manifest_urls from the embedded player_response being
overwritten with None. So use conservative_update instead
This commit is contained in:
James Taylor 2020-06-28 18:18:04 -07:00
parent aa3e5aa441
commit 803c901445

View File

@ -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 = {}