YouTube.js
Guide
Discord
❤️ Sponsor
GitHub
Guide
Discord
❤️ Sponsor
GitHub

youtubei.js / Types / ExtractionConfig

Interface: ExtractionConfig

Defined in: src/utils/javascript/JsAnalyzer.ts:4

Properties

collectDependencies?

optional collectDependencies: boolean

Defined in: src/utils/javascript/JsAnalyzer.ts:13

When false, dependency resolution is not enforced and extractions are marked as ready immediately when stopWhenReady is true.


friendlyName?

optional friendlyName: string

Defined in: src/utils/javascript/JsAnalyzer.ts:33

Name for easier identification of extractions.


match()

match: (node) => boolean | Node

Defined in: src/utils/javascript/JsAnalyzer.ts:8

Predicate that determines whether the current node should be considered a match.

Parameters

node

Node

Returns

boolean | Node


onlyProcessMatchContext?

optional onlyProcessMatchContext: boolean

Defined in: src/utils/javascript/JsAnalyzer.ts:29

If true, dependency collection is limited to the match context node itself.


stopWhenReady?

optional stopWhenReady: boolean

Defined in: src/utils/javascript/JsAnalyzer.ts:25

When true, traversal stops once the extraction is matched and all its dependencies (when collectDependencies=true) resolve. Only useful for small functions/vars without too many dependencies. Deeper dependency trees will usually have the unresolvable member expression here and there, for example:

 var Vmi = g.dX.window, Wr = Vmi?.yt?.config_ || Vmi?.ytcfg?.data_ || {};

Since Vmi.ytcfg is a dependency, it will never resolve because it comes from g.dX.window, which is an external object we don't have access to. In cases like this, stopWhenReady option does nothing useful.

Edit this page
Last Updated: 5/13/26, 3:20 AM