Skip to content

fix(player): support current signature and nsig extraction paths#1148

Closed
chadacious wants to merge 2 commits intoLuanRT:mainfrom
chadacious:codex/player-generalization
Closed

fix(player): support current signature and nsig extraction paths#1148
chadacious wants to merge 2 commits intoLuanRT:mainfrom
chadacious:codex/player-generalization

Conversation

@chadacious
Copy link

Fixes #1146

Summary

This updates player extraction to support the current signature and nsig patterns used by newer YouTube player variants.

What changed

  • stop stripping side-effect initializers when building extracted player scripts
  • preserve assignment/prototype dependency chains needed by current player helpers
  • detect current signature helpers semantically instead of relying on the older hard-coded matcher shape
  • derive nsig extraction from the same URL-helper class used by the matched signature helper

Notes

This was validated against multiple player ids, including:

  • 6c5cb4f4
  • 56211dc2
  • 99f55c01
  • ecc3e9a7
  • 05540cb0
  • 9f4cc5e4

and confirmed with real playback for both standard and purchased content in downstream integration testing.

Motivation

Recent player variants no longer match the older extraction assumptions:

  • some helpers are attached through prototype/member assignment chains
  • current signature helpers use a different structural shape
  • stripping side-effect initializers can remove code required for nsig evaluation

This patch updates the extractor and matchers to handle those cases while keeping the external decipher API unchanged.

@ziluotian
Copy link

When parsing this video (0P4A1K4lXDo) in the browser, the following message appears:

exportedVars.rawValues is not a function

@ziluotian
Copy link

ziluotian commented Mar 10, 2026

When parsing this video (0P4A1K4lXDo) in the browser, the following message appears:
Script: https://www.youtube.com/s/player/6c5cb4f4/player_es6.vflset/zh_CN/base.js
Failed to extract signature decipher function., Failed to extract n decipher function., exportedVars.rawValues is not a function

Simulating a mobile phone in the browser allows for normal parsing.
Script: https://m.youtube.com/s/player/6c5cb4f4/player-plasma-ias-phone-zh_CN.vflset/base.js

zImPatrick added a commit to zImPatrick/cobalt that referenced this pull request Mar 11, 2026
* LuanRT/YouTube.js/pull/1148 hasn't been merged in yet but old player ids have stopped working
unixfox added a commit to iv-org/YouTube.js that referenced this pull request Mar 11, 2026
unixfox added a commit to iv-org/invidious-companion that referenced this pull request Mar 11, 2026
unixfox added a commit to iv-org/invidious-companion that referenced this pull request Mar 11, 2026
* chore: use PR LuanRT/YouTube.js#1148

* fix PO token validation search filters

* chore: use fixed player id 01bde470
unixfox added a commit to iv-org/YouTube.js that referenced this pull request Mar 11, 2026
unixfox added a commit to iv-org/invidious-companion that referenced this pull request Mar 11, 2026
@ashleyirispuppy143
Copy link

ashleyirispuppy143 commented Mar 12, 2026

seems like music videos/topic channel content dont work with playback someetimes the rest work fine!

@br0k3x
Copy link

br0k3x commented Mar 12, 2026

when will this be merged?

@ashleyirispuppy143
Copy link

when will this be merged?

i think luan is working on a better fix himself. n-sig stuff is fine but the sig stuff isn't with this PR.

acheong08 pushed a commit to acheong08/invidious-companion that referenced this pull request Mar 13, 2026
* chore: use PR LuanRT/YouTube.js#1148

* fix PO token validation search filters

* chore: use fixed player id 01bde470
acheong08 pushed a commit to acheong08/invidious-companion that referenced this pull request Mar 13, 2026
zImPatrick added a commit to zImPatrick/cobalt that referenced this pull request Mar 14, 2026
* LuanRT/YouTube.js/pull/1148 hasn't been merged in yet but old player ids have stopped working
thatmarcel added a commit to thatmarcel/cobalt-feline that referenced this pull request Mar 14, 2026
@absidue
Copy link
Collaborator

absidue commented Mar 16, 2026

Superseded by #1152

@absidue absidue closed this Mar 16, 2026
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.

exportedVars.nFunction is not a function

5 participants