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

[bbc.co.uk] Try all possible mediaselectors even if one succeeds #26821

Closed
wants to merge 5 commits into from
Closed

[bbc.co.uk] Try all possible mediaselectors even if one succeeds #26821

wants to merge 5 commits into from

Conversation

dirkf
Copy link
Contributor

@dirkf dirkf commented Oct 6, 2020

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

Description of your pull request and other information

Some mediaselectors may be parseable but have no formats (eg captions only), eg https://www.bbc.co.uk/iplayer/episode/b0b3px4q.

This revision tries all possible mediaselectors and assembles the formats and subtitles found.

If any formats are found, the known exceptions ('notukerror', 'geolocation', 'selectionunavailable') are not propagated.

Should help with #23933.

Is there any need to try to de-duplicate formats?

Some mediaselectors may be parseable but have no formats (eg captions only).

This revision tries all possible mediaselectors and assembles the formats and subtitles found.

If any formats are found, the known exceptions ('notukerror', 'geolocation', 'selectionunavailable') are not propagated.
Trailing spaces in comments FFS!
The list of subtitles is initialised to None and may never become a list if no captions are found in the playlists.
The subtitles are parsed from each mediaselector playlist in the form of a dict keyed by language each of whose values is a list containing a dict keyed by url and sttl type. There seems to be no attempt in the extractor to make this list contain more than one dict. So a strategy is needed to deal with multiple sttl types for the same language.

For backward compatibility, let the first of any duplicate sttl languages take precedence.
@dirkf
Copy link
Contributor Author

dirkf commented Oct 13, 2020

I wrote:

Is there any need to try to de-duplicate formats?

No, because code in extractor/common.py sorts and de-duplicates.

@wrhwebmaster
Copy link

wrhwebmaster commented Oct 13, 2020

I tried the latest Windows EXE (on OS=Win10).
youtube-dl.exe -U
youtube-dl is up-to-date (2020.09.20)

youtube-dl.exe --verbose https://www.bbc.com/news/av/embed/p08fvzqq/52900486
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://www.bbc.com/news/av/embed/p08fvzqq/52900486']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2020.09.20
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: ffmpeg git-2020-05-15-b18fd2b
[debug] Proxy map: {}
[bbc] 52900486: Downloading webpage
[bbc] p08fvzqq: Downloading media selection XML
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\YoutubeDL.py", line 797, in extract_info
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\extractor\common.py", line 532, in extract
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\extractor\bbc.py", line 937, in _real_extract
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\extractor\common.py", line 1359, in _sort_formats
youtube_dl.utils.ExtractorError: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

@dirkf
Copy link
Contributor Author

dirkf commented Oct 13, 2020

At least from the UK, use this URL instead: https://www.bbc.co.uk/programmes/p08fvzq
This issue isn't fixed by the current PR.

@dirkf dirkf changed the title Try all possible mediaselectors even if one succeeds [bbc.co.uk] Try all possible mediaselectors even if one succeeds Nov 20, 2020
@dirkf
Copy link
Contributor Author

dirkf commented Nov 20, 2020

This patch has been successfully deployed to a set of Linux-based settop boxes since the PR was created.

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

Successfully merging this pull request may close these issues.

None yet

2 participants