-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[youtube] Extract formats from multiple DASH manifests (Closes #6093) #6097
[youtube] Extract formats from multiple DASH manifests (Closes #6093) #6097
Conversation
DASH manifest pointed by dashmpd from the video webpage and one pointed by get_video_info may be different (namely different itag set) - some itags are missing from DASH manifest pointed by webpage's dashmpd, some - from DASH manifest pointed by get_video_info's dashmpd). The general idea is to take a union of itags of both DASH manifests (for example video with such 'manifest behavior' see ytdl-org/youtube-dl#6093).
I would prefer to avoid doing an additional network request (potentially 4) by default, it probably makes directly playing the urls (for example with mpv) a bit slower. |
In most of the cases there would be only one additional network request. Otherwise, we may loose some formats or even the |
# Remove the formats we found through non-DASH, they | ||
# contain less info and it can be wrong, because we use | ||
# fixed values (for example the resolution). See | ||
# https://github.com/rg3/youtube-dl/issues/5774 for an | ||
# example. | ||
dash_keys = set(df['format_id'] for df in dash_formats) | ||
dash_keys = set(df['format_id'] for df in dash_formats.values()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The keys of the dash_formats
dict are the format_id
fields themselves, so you could directly set(dash_formats)
or set(dash_formats.keys())
to make it clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in d80265c.
Would it be better to skip the additional requests if And, I hope there's a test case for this PR. |
Since no DASH manifests downloaded when |
Yes. Sorry that the original statement is not clear enough. In this PR the additional get_video_info requests are for extracting more DASH urls. When those URLs are not used, I think there's no need to keep the requests. |
Fixed in 0a3cf9a. |
Looks good. |
I'd merge this if nobody minds. |
I think this PR can be merged. |
[youtube] Extract formats from multiple DASH manifests (Closes #6093)
DASH manifest pointed by dashmpd from the video webpage and one pointed by get_video_info may
be different (namely different itag set) - some itags are missing from DASH manifest pointed by
webpage's dashmpd, some - from DASH manifest pointed by get_video_info's dashmpd).
The general idea is to take a union of itags of both DASH manifests (for example video with such
'manifest behavior' see #6093).