yt-dlp: WARNING: [youtube] unable to extract initial player response
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
- I understand that I will be blocked if I intentionally remove or skip any mandatory* field
Checklist
- I’m reporting a bug unrelated to a specific site
- I’ve verified that I’m running yt-dlp version 2023.07.06 (update instructions) or later (specify commit)
- I’ve checked that all provided URLs are playable in a browser with the same IP and same login details
- I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
- I’ve searched known issues and the bugtracker for similar issues including closed ones. DO NOT post duplicates
- I’ve read the guidelines for opening an issue
Provide a description that is worded well enough to be understood
this is the error I get ( and it should be reported ) : [youtube] Extracting URL: https://www.youtube.com/watch?v=QYZ81Vl0qeI [youtube] QYZ81Vl0qeI: Downloading webpage WARNING: [youtube] unable to extract initial player response; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U [youtube] QYZ81Vl0qeI: Downloading ios player API JSON [youtube] QYZ81Vl0qeI: Downloading android player API JSON [youtube] QYZ81Vl0qeI: Downloading iframe API JS [youtube] QYZ81Vl0qeI: Downloading player 4cc5d082 [youtube] QYZ81Vl0qeI: Downloading web player API JSON [youtube] QYZ81Vl0qeI: Downloading m3u8 information WARNING: [youtube] unable to extract yt initial data; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U WARNING: [youtube] Incomplete data received in embedded initial data; re-fetching using API. [youtube] QYZ81Vl0qeI: Downloading initial data API JSON [info] QYZ81Vl0qeI: Downloading 1 format(s): 251 [download] Destination: 28. Francesco Onofrio Manfredini - Concerto Grosso in F Major, Op. 3, No. 8: IV. Presto.webm [download] 100% of 2.32MiB in 00:00:01 at 1.68MiB/s
I’m using version : E:\youtube4-dl\KLASSIEK\Baroque Concerto grosso\Francesco Onofrio Manfredini\Concerti Grossi Op. 3, Nos. 1-12>yt-dlp -vU [debug] Command-line config: [‘-vU’] [debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8 [debug] yt-dlp version stable@2023.07.06 [b532a3481] (win_exe) [debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19044-SP0 (OpenSSL 1.1.1k 25 Mar 2021) [debug] exe versions: ffmpeg N-109989-g7a8560cb22-20230310 (setts), ffprobe N-109989-g7a8560cb22-20230310 [debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.05.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3 [debug] Proxy map: {} [debug] Loaded 1855 extractors [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest Available version: stable@2023.07.06, Current version: stable@2023.07.06 Current Build Hash: 5ff3e702171a50175c34397494e2d18ce35d771c2110b1e59bd173ec2fb352aa yt-dlp is up to date (stable@2023.07.06)
Provide verbose output that clearly demonstrates the problem
- Run your yt-dlp command with -vU flag added (
yt-dlp -vU <your command line>
) - If using API, add
'verbose': True
toYoutubeDL
params instead - Copy the WHOLE output (starting with
[debug] Command-line config
) and insert it below
Complete Verbose Output
E:\youtube4-dl\KLASSIEK\Baroque Concerto grosso\Francesco Onofrio Manfredini\Concerti Grossi Op. 3, Nos. 1-12>yt-dlp -vU
[debug] Command-line config: ['-vU']
[debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.07.06 [b532a3481] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19044-SP0 (OpenSSL 1.1.1k 25 Mar 2021)
[debug] exe versions: ffmpeg N-109989-g7a8560cb22-20230310 (setts), ffprobe N-109989-g7a8560cb22-20230310
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.05.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1855 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.07.06, Current version: stable@2023.07.06
Current Build Hash: 5ff3e702171a50175c34397494e2d18ce35d771c2110b1e59bd173ec2fb352aa
yt-dlp is up to date (stable@2023.07.06)
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 9
- Comments: 40 (19 by maintainers)
Commits related to this issue
- [ie/youtube] Fix consent cookie (#7774) Fixes #7594 Authored by: coletdjnz — committed to yt-dlp/yt-dlp by coletdjnz a year ago
I have a page dump with the issue and the latest version of yt-dlp: yt-dlp-7594.zip.
Verbose log is inside the zip in
yt-dlp.log
. I also included the output ofyt-dlp -vU
inyt-dlp-vU.log
. Another thing, the video isn’t the same as arnot-bot. (It is ixQEzV7FQVc)I hope the page dump will help.
Run
yt-dlp --update-to nightly
and it should be fixedSo it’s being sent to the consent page, which I thought was supposed to be prevented by adding these query parameters:
In the redirect URL, and in its
<noscript><meta http-equiv="refresh" content="0;URL='{URL}'">
element the page is redirected via this URLhttps://consent.youtube.com/ml?continue=https://www.youtube.com/watch?v%3DixQEzV7FQVc%26bpctr%3D9999999999%26has_verified%3D1%26cbrd%3D1&gl=FR&hl=en&cm=4&pc=yt&src=1&rffu=true
, whosecontinue
URL has these additional parameters:As expected the redirection is not reproducible with yt-dlp stable (or yt-dl master) so it’s not possible to determine whether setting any of these parameters would avoid the problem.
Maybe try just detecting and following the redirected URL (with a loop detector, like Sheldon Cooper’s friendship algorithm)?
should be fixed with https://github.com/yt-dlp/yt-dlp/commit/378ae9f9fb8e8c86e6ac89c4c5b815b48ce93620
Hello guys. Guess this one can also be used a link for testing: https://www.youtube.com/watch?v=ruvPCs4i_G4
Also getting “WARNING: [youtube] unable to extract initial player response” ./yt-dlp -vU -F “https://www.youtube.com/watch?v=ruvPCs4i_G4” [debug] Command-line config: [‘-vU’, ‘-F’, ‘https://www.youtube.com/watch?v=ruvPCs4i_G4’] [debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8 [debug] yt-dlp version stable@2023.07.06 [b532a3481] (zip) [debug] Python 3.11.4 (CPython arm64 64bit) - macOS-13.5-arm64-arm-64bit (OpenSSL 3.1.2 1 Aug 2023) [debug] exe versions: phantomjs 2.1.1 [debug] Optional libraries: sqlite3-2.6.0 [debug] Proxy map: {} [debug] Extractor Plugins: SamplePluginIE [debug] Post-Processor Plugins: SamplePluginPP [debug] Loaded 1934 extractors [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest Available version: stable@2023.07.06, Current version: stable@2023.07.06 Current Build Hash: 94c2abc8ac8b03e128067aee1a07937884068af049431620f76579612c0f8da0 yt-dlp is up to date (stable@2023.07.06) [youtube] Extracting URL: https://www.youtube.com/watch?v=ruvPCs4i_G4 [youtube] ruvPCs4i_G4: Downloading webpage WARNING: [youtube] unable to extract initial player response; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U [youtube] ruvPCs4i_G4: Downloading ios player API JSON [youtube] ruvPCs4i_G4: Downloading android player API JSON [youtube] ruvPCs4i_G4: Downloading iframe API JS [youtube] ruvPCs4i_G4: Downloading player 3cd2d050 [youtube] ruvPCs4i_G4: Downloading web player API JSON [youtube] ruvPCs4i_G4: Downloading m3u8 information WARNING: [youtube] unable to extract yt initial data; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U WARNING: [youtube] Incomplete data received in embedded initial data; re-fetching using API. [youtube] ruvPCs4i_G4: Downloading initial data API JSON [debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto [debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id …
Sounds very plausible, since that
1689897600
value represents a date and time value ofFri 21 Jul 2023 00:00:00 UTC
(as number of seconds since epoch, 1970-01-01 UTC):Reproducible in EU. There is a new consent page that YouTube is redirecting to (A/B testing). The
CONSENT
cookie does not seem to be used anymore in this case (for consenting YES), rather looks to be reliant on a new cookie calledSOCS
?SOCS cookie after consenting looks like this:
CAISNQgDEitib3FfaWRlbnRpdHlmcm9udGVuZHVpc2VydmVyXzIwMjMwNzE4LjA3X3AyGgJlbiACGgYIgJXnpQY
which is b64 encoded protobuf:
This might be generic enough for us to hardcode, but will need to investigate some of these values.
And prior to consenting the SOCS cookie looks like:
CAAaBgiAleelBg
=Edit: Alternative is to set
ucbcb=1
query parameter on urls, which some other clients (e.g. NewPipe) do.yt-dlp --update-to nightly
or https://github.com/yt-dlp/yt-dlp/wiki/Installation#pip-master or https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latestI got this error today:
Using latest version:
FWIW, the video ID posted by @Atulin has no issue whatsoever 🎉 here being downloaded with the latest nightly
yt-dlp_x86.exe
build:I had the same issue and updating to nightly fixed it, but now the downloads seem to be time-outing
This URL affected too: https://www.youtube.com/watch?v=l0vveyYODpQ
yt-dlp 2023.07.06
This isn’t effective in yt-dl at least.
Possibly relevant background (maybe not news to experts here):
We should make sure to check that this works with cookies - this parameter is apprently used by Google to bypass consent pages when cookies are blocked.
We also need to figure out what pages need this parameter. Since this may also impact tab extractor and other webpages we download from YouTube.
If this works, this may be the way to go. The
1689897600
value in the protobuf makes me think that hard-coding it would only be useful for a limited timeI believe that I saw this, intermittently, with yt-dl while testing https://github.com/ytdl-org/youtube-dl/issues/32458, but assumed there was a network glitch. In some cases, extraction was sent down the age-gate path (youtube-dl/youtube_dl/extractor/youtube.py#L1880). The YT video was
imZxxximci0
. Now, ofc, it’s all fine. Can we put it down to a CDN bug? Or perhaps a new page structure was being trialled?“me too” comments are SPAM. If you want to actually help, do https://github.com/yt-dlp/yt-dlp/issues/7594#issuecomment-1636870165