yt-dlp: [YouTube] Signature extraction failed: Some formats may be missing
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 that yt-dlp is broken on a supported site
- I’ve verified that I’m running yt-dlp version 2023.03.04 (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
- I’ve read about sharing account credentials and I’m willing to share it if required
Region
Spain
Provide a description that is worded well enough to be understood
Hello!!! As for today, “player_client=web” is not working, says “Signature extraction failed: Some formats may be missing”. Please fix it!!! I will wait for the response!!! Thank you!!!
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:\>yt-dlp --list-formats --cookies-from-browser firefox:627tis7f.default-release -vU --extractor-args "youtube:player_client=web" ytsearch:"Pinkfong Baby Shark Dance"
[debug] Command-line config: ['--list-formats', '--cookies-from-browser', 'firefox:627tis7f.default-release', '-vU', '--extractor-args', 'youtube:player_client=web', 'ytsearch:Pinkfong Baby Shark Dance']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2023.06.15.232317 [0a5d7c39e] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22621-SP0 (OpenSSL 1.1.1k 25 Mar 2021)
[debug] exe versions: ffmpeg 2023-06-08-git-024c30aa3b-full_build-www.gyan.dev (setts), ffprobe 2023-06-08-git-024c30aa3b-full_build-www.gyan.dev, phantomjs 2.1.1
[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
[Cookies] Extracting cookies from firefox
[debug] Extracting cookies from: "C:\Users\joaqu\AppData\Roaming\Mozilla\Firefox\Profiles\627tis7f.default-release\cookies.sqlite"
[Cookies] Extracted 2784 cookies from firefox
[debug] Proxy map: {}
[debug] Loaded 1845 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Available version: nightly@2023.06.15.232317, Current version: nightly@2023.06.15.232317
Current Build Hash: ce5fc95676322dd22223454ddbb4328d2f98f1b252ce7974026e2116c743018f
yt-dlp is up to date (nightly@2023.06.15.232317)
[youtube:search] Extracting URL: ytsearch:Pinkfong Baby Shark Dance
[download] Downloading playlist: Pinkfong Baby Shark Dance
[youtube:search] query "Pinkfong Baby Shark Dance": Downloading web client config
[debug] [youtube:search] Extracted SAPISID cookie
[youtube:search] query "Pinkfong Baby Shark Dance" page 1: Downloading API JSON
[youtube:search] Playlist Pinkfong Baby Shark Dance: Downloading 1 items of 1
[download] Downloading item 1 of 1
[youtube] Extracting URL: https://www.youtube.com/watch?v=XqZsoesa55w
[youtube] XqZsoesa55w: Downloading webpage
[debug] [youtube] Extracting signature function js_6ed0d907_106
[youtube] XqZsoesa55w: Downloading player 6ed0d907
WARNING: [youtube] XqZsoesa55w: Signature extraction failed: Some formats may be missing
[debug] [youtube] Traceback (most recent call last):
File "yt_dlp\extractor\youtube.py", line 3081, in inner
File "yt_dlp\extractor\youtube.py", line 3009, in _extract_signature_function
File "yt_dlp\extractor\youtube.py", line 3075, in <lambda>
File "yt_dlp\utils\_utils.py", line 5539, in __call__
File "yt_dlp\jsinterp.py", line 850, in resf
File "yt_dlp\jsinterp.py", line 185, in interpret_statement
File "yt_dlp\jsinterp.py", line 338, in interpret_statement
File "yt_dlp\jsinterp.py", line 185, in interpret_statement
File "yt_dlp\jsinterp.py", line 756, in interpret_statement
File "yt_dlp\jsinterp.py", line 748, in eval_method
KeyError: 'QV'
(caused by KeyError('QV')); 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
[debug] [youtube] Extracting signature function js_6ed0d907_110
WARNING: Only images are available for download. use --list-formats to see them
[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, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[info] Available formats for XqZsoesa55w:
ID EXT RESOLUTION FPS │ PROTO │ VCODEC MORE INFO
────────────────────────────────────────────────────
sb2 mhtml 48x27 1 │ mhtml │ images storyboard
sb1 mhtml 80x45 1 │ mhtml │ images storyboard
sb0 mhtml 160x90 1 │ mhtml │ images storyboard
[download] Finished downloading playlist: Pinkfong Baby Shark Dance
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 32 (10 by maintainers)
Links to this issue
Commits related to this issue
- [YouTube] Fix `KeyError QV` in signature extraction failed * temporarily force missing global definition into sig JS * improve test: thanks https://github.com/yt-dlp/yt-dlp/issues/7327#issuecomment-15... — committed to ytdl-org/youtube-dl by dirkf a year ago
- [bot] AutoMerging: merge all upstream's changes: * https://github.com/ytdl-org/youtube-dl: [YouTube] Fix `KeyError QV` in signature extraction failed * temporarily force missing global definition i... — committed to hellopony/youtube-dl by github-actions[bot] a year ago
- [jsinterp] Fix global object extraction Closes #7327 — committed to yt-dlp/yt-dlp by pukkandan a year ago
a no-cookies-necessary workaround for now:
copy the below text and save as
~/.cache/yt-dlp/youtube-sigfuncs/js_6ed0d907_106.json
and save the below text as
~/.cache/yt-dlp/youtube-sigfuncs/js_6ed0d907_110.json
After all that, it turns out that the workaround for verified cookies is enabled by default 🤣 Anyways, thanks for the help @estatistics
@gamer191 try with an age-gated video, e.g.
b5A8Zy6tgcg
also to clarify, this is not n-sig. this is signature extraction, for which failure results in missing formats rather than throttled formats, and for which yt-dlp does not use phantomjs as a fallback
I tried to remove cache and the problem persists, please fix this issue now!!!
log
Yes, prepending
'var AH={LR:function(a,b){var c=a[0];a[0]=a[b%a.length];a[b%a.length]=c},QV:function(a){a.reverse()},pO:function(a,b){a.splice(0,b)}};'
tojscode
inYoutubeIE._parse_sig_js()
fixes the issue for yt-dl.The code currently finds the function
d.AH
(inJSInterpreter.extract_object()
), which has no.QV
. Instead of skippingthis.AH
, it should skip{_NAME_RE}.AH
<strike>, but that doesn’t fix the problem in itself</strike>, which fixes the problem if done correctly (!).@bashonly I can reproduce now
The
AH
object is not being passed to the signature code.A first-level fix could be to hard-wire the
AH
object in the context of the signature code; the second level, find and evaluate the object and pass it; the third level, evaluate the 2MB player code and pass the entire context in which the signature code is defined.I am getting player
6ed0d907
w/o cookies now. It breaks age-gated video extraction like in the previous commentIssue can be reproduced by directly testing the player JS, no account needed.
per discord, when OP tried w/o passing cookies, it worked: