Skip to content
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

Get HD formats for Reel #28332

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

dirkf
Copy link
Contributor

@dirkf dirkf commented Mar 3, 2021

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Per #21870 (comment), we don't get the highest resolution formats through the BBCIE extractor. This patch gets the metadata that is available from the Reel page and then uses the url_transparent mechanism to get the formats, which now include 1280x720 as well as the 960x540 and lower available from the BBCIE extractor.

@remitamine
Copy link
Collaborator

no, using the default _MEDIA_SETS from BBCCoUkIE should be enough instead of adding another unnecessary request.

@dirkf
Copy link
Contributor Author

dirkf commented Mar 3, 2021

I thought it would and that was my first pass, but it didn't work for me. It does when (logically enough) the value was set before _download_media_selector, as in the latest version.

Presumably there's a good reason why this isn't the default for BBCIE, relative to the comment at https://github.com/dirkf/youtube-dl/blob/49d83ee5022be269dbacc5e1300d331350f1a125/youtube_dl/extractor/bbc.py#L54.

Is this robust against failing to fetch the iptv-all sets?

Is there a danger of returning formats that the user can't actually reach?

Comment on lines 998 to 999
programme_id = self._search_regex(
r'/reel/video/(?P<id>%s)/' % self._ID_REGEX, url, 'Reel pid', default=None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated.

formats, subtitles = self._download_media_selector(version_id)
self._sort_formats(formats)
image_url = smp_data.get('holdingImageURL')
display_date = init_data.get('displayDate')
topic_title = init_data.get('topicTitle')

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated.

Comment on lines +1011 to +1012
# also try for higher resolutions
self._MEDIA_SETS.insert(0, 'iptv-all')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as the iptv-all gives better quality in general, just drop _MEDIA_SETS from the extractor and just use the default value from BBCCoUkIE.

@Vangelis66 Vangelis66 mentioned this pull request Mar 3, 2021
5 tasks
@Vangelis66
Copy link

Please kindly consider what's detailed in #21870 (comment) ; thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants