NewPipeExtractor icon indicating copy to clipboard operation
NewPipeExtractor copied to clipboard

Throttling/n-parameter deobfuscation not working

Open litetex opened this issue 5 months ago • 2 comments

Currently the n-Parameter deobfuscation is not working (we get an empty string for n).

We should check if this is still required and if so try to fix it.

Reference code (check if it works before porting)

  • from yt-dlp: https://github.com/ytdl-org/youtube-dl/blob/a084c80f7bac9ae343075a97cc0fb2c1c96ade89/youtube_dl/extractor/youtube.py#L1878-L2011
  • from invidious: https://github.com/iv-org/inv_sig_helper/blob/master/src/player.rs

litetex avatar Jul 16 '25 19:07 litetex

Just for the protocol from Matrix:

Stypox Maybe it was caused by https://github.com/TeamNewPipe/NewPipeExtractor/pull/1290 Anyway, it's not currently used iirc, except for a fallback method somewhere (maybe for age-restricted videos? AudricV probably remembers). But you never know, maybe we'll need to do a hotfix at some point where we'll need to temporarily switch to a different client that has n-params, and in that case it'd be good to have the code ready.

AudricV Your guess is right, even if YouTube is testing a new player calling external functions in variables if I remember properly

So I guess this can be removed completely...

litetex avatar Jul 17 '25 18:07 litetex

Mod note: Context: additional information/update about how ytdlp does this

ytdlp; Up until now, yt-dlp has been able to use its built-in JavaScript "interpreter" to solve the JavaScript challenges that are required for YouTube downloads. But due to https://github.com/yt-dlp/yt-dlp/issues/14400, the built-in JS interpreter will soon be insufficient for this purpose.

There is a personal implementation of grayjay or ytdlp for this. I wrote about this in the Matrix. But I wanted to mention it here. If Newpipe improves this, it means you don't have to update it every time.

ytdlp Deno;

uses; https://github.com/yt-dlp/ejs pr; https://github.com/yt-dlp/yt-dlp/pull/14157

or using the smaller size Quickjs

ytdlp support this

https://github.com/yt-dlp/yt-dlp/issues/14431

https://github.com/yausername/youtubedl-android/pull/338

alimima avatar Oct 01 '25 17:10 alimima