Why does YT-DLP only download SD in 396p from iPlayer yet get_iplayer downloads in 540p?
See original GitHub issueDO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
- I understand that I will be blocked if I remove or skip any mandatory* field
Checklist
- Iβm asking a question and not reporting a bug or requesting a feature
- Iβve looked through the README
- Iβve verified that Iβm running yt-dlp version 2022.09.01 (update instructions) or later (specify commit)
- Iβve searched the bugtracker for similar questions including closed ones. DO NOT post duplicates
- Iβve read the guidelines for opening an issue
Please make sure the question is worded well enough to be understood
Trying to download this standard definition video in the best quality: https://www.bbc.co.uk/iplayer/episode/p00yzpg2/top-gear-series-1-episode-1
Get_iplayer downloads it in the best quality it can get at 960 x 540p 25 fps with AAC 96 Kbps YT-DLP downloading in the best quality only gets it in 704 x 396p 50 fps, however it gets a better audio quality at AAC 128 Kbps.
YT-DLP --list-formats canβt even see the 960 x 540p. Why is that when get_iplayer can?
How can I get yt-dlp to download the 960 x 540p version? Hereβs my script:
-f ("bestvideo[width>=1920]"/bestvideo[ext=avc1])+bestaudio/best
Thanks
Provide verbose output that clearly demonstrates the problem
- Run your yt-dlp command with -vU flag added (
yt-dlp -vU <your command line>
) - Copy the WHOLE output (starting with
[debug] Command-line config
) and insert it below
Complete Verbose Output
X:\Portable Installations\YouTube-DL>cd /D "X:\Portable Installations\YouTube-DL
\"
X:\Portable Installations\YouTube-DL>yt-dlp -vU yt-dlp https://www.bbc.co.uk/ipl
ayer/episode/p00yzpg2/top-gear-series-1-episode-1 --list-formats
[debug] Command-line config: ['-vU', 'yt-dlp', 'https://www.bbc.co.uk/iplayer/ep
isode/p00yzpg2/top-gear-series-1-episode-1', '--list-formats']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8 (No VT), erro
r utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version 2022.09.01 [5d7c7d6] (win32_exe)
[debug] Python 3.8.10 (CPython 64bit) - Windows-7-6.1.7601-SP1
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg N-65018-gad91bf8 (needs_adtstoasc), ffprobe N-65018
-gad91bf8
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15,
mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Loaded 1670 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releas
es/latest
Latest version: 2022.09.01, Current version: 2022.09.01
yt-dlp is up to date (2022.09.01)
[debug] [CommonMistakes] Extracting URL: yt-dlp
ERROR: [CommonMistakes] You've asked yt-dlp to download the URL "yt-dlp". That d
oesn't make any sense. Simply remove the parameter in your command or configurat
ion.
File "yt_dlp\extractor\common.py", line 670, in extract
File "yt_dlp\extractor\commonmistakes.py", line 25, in _real_extract
[debug] [bbc.co.uk] Extracting URL: https://www.bbc.co.uk/iplayer/episode/p00yzp
g2/top-gear-series-1-episode-1
[bbc.co.uk] p00yzpg2: Downloading video page
[bbc.co.uk] p00yzpg2: Downloading playlist JSON
[bbc.co.uk] p00yzpg3: Downloading media selection JSON
[bbc.co.uk] p00yzpg3: Downloading m3u8 information
[bbc.co.uk] p00yzpg3: Downloading m3u8 information
[bbc.co.uk] p00yzpg3: Downloading m3u8 information
[bbc.co.uk] p00yzpg3: Downloading m3u8 information
[bbc.co.uk] p00yzpg3: Downloading m3u8 information
[bbc.co.uk] p00yzpg3: Downloading m3u8 information
[bbc.co.uk] p00yzpg3: Downloading MPD manifest
[bbc.co.uk] p00yzpg3: Downloading MPD manifest
[bbc.co.uk] p00yzpg3: Downloading MPD manifest
[bbc.co.uk] p00yzpg3: Downloading MPD manifest
[bbc.co.uk] p00yzpg3: Downloading MPD manifest
[bbc.co.uk] p00yzpg3: Downloading MPD manifest
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7),
vcodec:vp9.2(10), channels, acodec, filesize, fs_approx, tbr, vbr, abr, asr, pro
to, vext, aext, hasaud, source, id
[info] Available formats for p00yzpg3:
ID EXT RESOLUTION FPS | FILESIZE TBR PROTO |
VCODEC VBR ACODEC ABR ASR MORE INFO
--------------------------------------------------------------------------------
--------------------------------------------------------------
mf_akamai-audio_eng_1=128000-0 m4a audio only | ~ 56.25MiB 128k dash |
audio only mp4a.40.2 128k 48k [en] Original, m4a_dash
mf_akamai-audio_eng_1=128000-1 m4a audio only | ~ 56.25MiB 128k dash |
audio only mp4a.40.2 128k 48k [en] Original, m4a_dash
mf_bidi-audio_eng_1=128000-0 m4a audio only | ~ 56.25MiB 128k dash |
audio only mp4a.40.2 128k 48k [en] Original, m4a_dash
mf_bidi-audio_eng_1=128000-1 m4a audio only | ~ 56.25MiB 128k dash |
audio only mp4a.40.2 128k 48k [en] Original, m4a_dash
mf_cloudfront-audio_eng_1=128000-0 m4a audio only | ~ 56.25MiB 128k dash |
audio only mp4a.40.2 128k 48k [en] Original, m4a_dash
mf_cloudfront-audio_eng_1=128000-1 m4a audio only | ~ 56.25MiB 128k dash |
audio only mp4a.40.2 128k 48k [en] Original, m4a_dash
mf_akamai-video=827000-0 mp4 704x396 25 | ~363.43MiB 827k dash |
avc3.4D401E 827k video only Original, mp4_dash
mf_akamai-video=827000-1 mp4 704x396 25 | ~363.43MiB 827k dash |
avc3.4D401E 827k video only Original, mp4_dash
mf_bidi-video=827000-0 mp4 704x396 25 | ~363.43MiB 827k dash |
avc3.4D401E 827k video only Original, mp4_dash
mf_bidi-video=827000-1 mp4 704x396 25 | ~363.43MiB 827k dash |
avc3.4D401E 827k video only Original, mp4_dash
mf_cloudfront-video=827000-0 mp4 704x396 25 | ~363.43MiB 827k dash |
avc3.4D401E 827k video only Original, mp4_dash
mf_cloudfront-video=827000-1 mp4 704x396 25 | ~363.43MiB 827k dash |
avc3.4D401E 827k video only Original, mp4_dash
mf_akamai-1013-0 mp4 704x396 25 | ~445.17MiB 1013k m3u8 |
avc1.4D401E 827k mp4a.40.2 128k Original
mf_akamai-1013-1 mp4 704x396 25 | ~445.17MiB 1013k m3u8 |
avc1.4D401E 827k mp4a.40.2 128k Original
mf_bidi-1013-0 mp4 704x396 25 | ~445.17MiB 1013k m3u8 |
avc1.4D401E 827k mp4a.40.2 128k Original
mf_bidi-1013-1 mp4 704x396 25 | ~445.17MiB 1013k m3u8 |
avc1.4D401E 827k mp4a.40.2 128k Original
mf_cloudfront-1013-0 mp4 704x396 25 | ~445.17MiB 1013k m3u8 |
avc1.4D401E 827k mp4a.40.2 128k Original
mf_cloudfront-1013-1 mp4 704x396 25 | ~445.17MiB 1013k m3u8 |
avc1.4D401E 827k mp4a.40.2 128k Original
mf_akamai-video=1570000-0 mp4 704x396 50 | ~689.94MiB 1570k dash |
avc3.64001F 1570k video only Original, mp4_dash
mf_akamai-video=1570000-1 mp4 704x396 50 | ~689.94MiB 1570k dash |
avc3.64001F 1570k video only Original, mp4_dash
mf_bidi-video=1570000-0 mp4 704x396 50 | ~689.94MiB 1570k dash |
avc3.64001F 1570k video only Original, mp4_dash
mf_bidi-video=1570000-1 mp4 704x396 50 | ~689.94MiB 1570k dash |
avc3.64001F 1570k video only Original, mp4_dash
mf_cloudfront-video=1570000-0 mp4 704x396 50 | ~689.94MiB 1570k dash |
avc3.64001F 1570k video only Original, mp4_dash
mf_cloudfront-video=1570000-1 mp4 704x396 50 | ~689.94MiB 1570k dash |
avc3.64001F 1570k video only Original, mp4_dash
mf_akamai-1800-0 mp4 704x396 50 | ~791.02MiB 1800k m3u8 |
avc1.64001F 1570k mp4a.40.2 128k Original
mf_akamai-1800-1 mp4 704x396 50 | ~791.02MiB 1800k m3u8 |
avc1.64001F 1570k mp4a.40.2 128k Original
mf_bidi-1800-0 mp4 704x396 50 | ~791.02MiB 1800k m3u8 |
avc1.64001F 1570k mp4a.40.2 128k Original
mf_bidi-1800-1 mp4 704x396 50 | ~791.02MiB 1800k m3u8 |
avc1.64001F 1570k mp4a.40.2 128k Original
mf_cloudfront-1800-0 mp4 704x396 50 | ~791.02MiB 1800k m3u8 |
avc1.64001F 1570k mp4a.40.2 128k Original
mf_cloudfront-1800-1 mp4 704x396 50 | ~791.02MiB 1800k m3u8 |
avc1.64001F 1570k mp4a.40.2 128k Original
X:\Portable Installations\YouTube-DL>PAUSE
Press any key to continue . . .
Issue Analytics
- State:
- Created a year ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Only downloading videos older than a half hour ago? - Reddit
Hello, new user using yt-dlp. What I am looking to do is run a download script repeatedly but have it only download new...
Read more >ArcoLinux : 2326 Use yt-dlp to download videos and see them ...
Your browser can 't play this video. ... ArcoLinux : 2326 Use yt - dlp to download videos and see them at a...
Read more >yt-dlp - bytemeta
yt -dlp repo issues. ... Why does YT-DLP only download SD in 396p from iPlayer yet get_iplayer downloads in 540p? Puspam9876.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
β¦ Well, I may not know perl (
get_iplayer
) or python (youtube-dl
,yt-dlp
), but there was a time ago I knew well the inner workings of iPlayer itselfβ¦Drawing from that past knowledge, here are some facts:
pid=p00yzpg2
vpid
), Iβd use this following API:https://www.bbc.co.uk/programmes/<pid>/playlist.json
which now gets me: https://www.bbc.co.uk/programmes/p00yzpg2/playlist.json Parsing the JSON result, I get:vpid=p00yzpg3
https://open.live.bbc.co.uk/mediaselector/6/select/version/2.0/mediaset/<mediaset>/vpid/<vpid>/format/xml
youtube-dl
andyt-dlp
both use the following two mediasets:iptv-all
,pc
, with priority given to the first one⦠From a whitelisted UK IP address (I live overseas), both URIs:https://open.live.bbc.co.uk/mediaselector/6/select/version/2.0/mediaset/iptv-all/vpid/p00yzpg3/format/xml https://open.live.bbc.co.uk/mediaselector/6/select/version/2.0/mediaset/pc/vpid/p00yzpg3/format/xml
return the
396p50
encodes!Later addition/correction: As correctly pointed out by dirkf, the
pc
mediaset also affords the540p25
encodes discussed here - both as MPEG-DASH+HLS streams, but thebbcIE
insideyt-dlp
doesnβt query this mediaset for formats; the logic being to avoid extra, unnecessary, HTTP requests to BBC servers, given that theiptv-all
mediaset, prioritised bybbcIE
, already affords usable streams (but not the540p25
ones, hence this issueβ¦).But
get_iplayer
also uses two other βmobileβ mediasets, one of which isapple-ipad-hls
(the other beingapple-iphone4-ipad-hls-3g
); below URI:https://open.live.bbc.co.uk/mediaselector/6/select/version/2.0/mediaset/apple-ipad-hls/vpid/p00yzpg3/format/xml
will produce HLS manifests, the highest resolution variant being
540p25
:Reason is
yt-dlp
doesnβt check at all theapple-ipad-hls
mediaset value; butget_iplayer
does!Later addition: While my statement above is indeed true, the reason
yt-dlp
fails is different; itsbbcIE
will only try two mediasets, as said previously, but once usable streams are being found with theiptv-all
mediaset (first in priority), the second mediaset,pc
, is never tried for additional formats (which would have afforded the missing540p25
encodes in question), to spare BBC servers from unnecessary web requestsβ¦Different mediaset values have different audio streams associated with themβ¦ On a mobile device, the highest audio bitrate the BBC would deliver is 96kbps HE-AACv1, while on connected TVs it will deliver 128kbps AAC-LC (used to be even 320kbps some years agoβ¦). I believe the code can be hacked to fetch a
540p25
video-only stream from theapple-ipad-hls
mediaset and a 128kbps audio-only stream from theiptv-all
mediaset, but absolute A/V sync is not always guaranteed that wayβ¦FWIW, the BBC themselves consider higher framerates to deliver better picture quality than higher vertical resolution alone (this is sometimes true in Sports coverage), so in their eyes
396p50
is better than540p25
(hence theyβre serving the former to connected TVs) β¦Right. This is an old issue that was supposed to be fixed ages ago for yt-dl in https://github.com/ytdl-org/youtube-dl/pull/26821. However the developer who closed that PR implemented a different βsolutionβ that didnβt fully address the problem. Possibly the concern was making too many requests to the BBC servers.
True enough. In fact, the 540p formats found by get_iplayer are 25fps while the 396p formats max out at 50fps with the same bit-rate.
Currently, iPlayer extraction looks for two media selectors:
The
pc
selector does actually provide the 540p/25fps formats, but the extractor only gathers formats from the first selector that has any. The underlying issue is that the set of formats provided by each media selector may differ for each programme, and so no single media selector reliably gives the full range of formats. So either you get missing formats or you make more, possibly unnecessary, requests.This patch ensures that all selectors are interrogated (again, but better now):
Then: