Skip to content

Upgrade youtubei.js to 16.0.1 and fix downloader plugin#2

Merged
Daksh777 merged 2 commits into
masterfrom
copilot/update-youtubei-js-version
Nov 9, 2025
Merged

Upgrade youtubei.js to 16.0.1 and fix downloader plugin#2
Daksh777 merged 2 commits into
masterfrom
copilot/update-youtubei-js-version

Conversation

Copilot AI commented Nov 9, 2025

Copy link
Copy Markdown

Ports pear-devs#4069 to fix the downloader plugin for youtubei.js v16, which deprecated the player_id configuration in favor of signature function evaluation via Platform.shim.eval.

Changes

  • package.json: Upgrade youtubei.js 15.0.1^16.0.1
  • pnpm-lock.yaml: Update transitive dependencies (jintr → meriyah, @bufbuild/protobuf → 2.6.3)
  • src/plugins/downloader/main/index.ts:
    • Import Platform from youtubei.js
    • Add Platform.shim.eval handler before Innertube.create()
    • Remove hardcoded player_id: '0004de42' from config

Example

// Set up Platform shim for signature function evaluation
Platform.shim.eval = (code: string) => {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
  return eval(code);
};

yt = await Innertube.create({
  cache: new UniversalCache(false),
  // player_id removed - now handled by Platform.shim.eval
  cookie: await getCookieFromWindow(win),
  generate_session_locally: true,
  fetch: getNetFetchAsFetch(),
});

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • iojs.org
    • Triggering command: curl --fail --compressed -q -L -s REDACTED -o - (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Import the changes from pear-devs#4069 (Fix downloader plugin) which includes:

  1. Upgrade youtubei.js from version 15.0.1 to ^16.0.1 in package.json
  2. Update pnpm-lock.yaml with the new youtubei.js 16.0.1 and its updated dependencies (replacing jintr with meriyah, updating @bufbuild/protobuf to 2.10.0, and exponential-backoff to 3.1.3)
  3. Update src/plugins/downloader/main/index.ts to:
    • Import Platform from youtubei.js
    • Add Platform.shim.eval function for handling signature function evaluation
    • Remove the hardcoded player_id: '0004de42' from the Innertube.create() configuration

These changes fix the downloader plugin to work with youtubei.js version 16 and handle the deprecated player_id approach.

This pull request was created as a result of the following prompt from Copilot chat.

Import the changes from pear-devs#4069 (Fix downloader plugin) which includes:

  1. Upgrade youtubei.js from version 15.0.1 to ^16.0.1 in package.json
  2. Update pnpm-lock.yaml with the new youtubei.js 16.0.1 and its updated dependencies (replacing jintr with meriyah, updating @bufbuild/protobuf to 2.10.0, and exponential-backoff to 3.1.3)
  3. Update src/plugins/downloader/main/index.ts to:
    • Import Platform from youtubei.js
    • Add Platform.shim.eval function for handling signature function evaluation
    • Remove the hardcoded player_id: '0004de42' from the Innertube.create() configuration

These changes fix the downloader plugin to work with youtubei.js version 16 and handle the deprecated player_id approach.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 9, 2025
Co-authored-by: Daksh777 <43648146+Daksh777@users.noreply.github.com>
Copilot AI changed the title [WIP] Import changes to fix downloader plugin with youtubei.js version 16 Upgrade youtubei.js to 16.0.1 and fix downloader plugin Nov 9, 2025
Copilot AI requested a review from Daksh777 November 9, 2025 17:06
@Daksh777 Daksh777 marked this pull request as ready for review November 9, 2025 17:07
@Daksh777 Daksh777 merged commit 1628e4b into master Nov 9, 2025
14 checks passed
@Daksh777 Daksh777 deleted the copilot/update-youtubei-js-version branch November 13, 2025 12:12
@Daksh777 Daksh777 restored the copilot/update-youtubei-js-version branch November 13, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants