1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-07-19 19:58:30 +00:00

Populate formats only after checking streamUrl

Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
flanter21 2025-07-16 16:08:59 +03:00 committed by GitHub
parent 93a2278b99
commit 26d59b5c1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -119,10 +119,10 @@ def _real_extract(self, url):
video_info = self._call_api(region, video_id, 'data', note='Trying fallback', fatal=True) video_info = self._call_api(region, video_id, 'data', note='Trying fallback', fatal=True)
video_extra = {} video_extra = {}
formats = traverse_obj(video_info, ('extStreams', ..., { formats = traverse_obj(video_info, ('extStreams', lambda _, v: url_or_none(v['streamUrl']), {
'url': ('streamUrl', {url_or_none}), 'url': 'streamUrl',
'container': ('contentType', {mimetype2ext}), 'ext': ('contentType', {mimetype2ext}),
'aspect_ratio': ('aspectRatio'), 'aspect_ratio': ('aspectRatio', {float_or_none}),
})) }))
for cur_format in formats: for cur_format in formats: