2 Finding a player_id to hardcode it into Invidious Companion
Fijxu edited this page 2025-09-24 10:20:25 -03:00

Some background about this issue

When Youtube makes player changes, they often change their signature decipher algorithm, which is an algorithm needed to decipher the Youtube videos, making Invidious companion able to serve video.

Sometimes, when they change their signature decipher algorithm, Invidious companion is not able able to extract it and therefore we need to wait for the upstream project Youtube.JS that we use as a dependency to fix it, which can take a few days or a few weeks, the time will depend on how easy is to extract the signature decipher algorithm from the Youtube player.

Finding a player_id to hardcode it

Good sources to find an old player_id that worked well before youtube changed their signature decipher algorithm are:

Currently, you may be able to find a working old player_id searching on projects that also use Youtube.JS or are related to Youtube, as there is no repository or webpage that keeps track of all player_id that youtube has rolled out.

Hardcode the player_id

Open ./src/constants.ts and set PLAYER_ID to a valid, working player_id.

Example:

export const PLAYER_ID = "0004de42";

Test it

Execute deno run dev and wait until Invidious companion is able to get a valid PO Token (You will see [INFO] Successfully generated PO token in the logs).

Now try it in your Invidious instance, if videos load and play fine, that player_id is still valid and can be hardcoded into Invidious companion if necessary.

Additional information

As 2025-09-24, yt-dlp uses https://github.com/yt-dlp/yt-dlp/pull/14398 and they got the old player_id 0004de42 because the maintainer seproDev made a little program that keeps track of all the player_ids that Youtube has rolled out over the time.

image