mirror of
https://github.com/iv-org/invidious-companion.git
synced 2025-09-29 18:32:50 -06:00
Page:
Use specific fork from iv‐org YouTube.js
Pages
Environment variables
Finding a player_id to hardcode it into Invidious Companion
Home
How to communicate with Invidious companion with any client (HTTP API)
Setup Invidious companion on a separate subdomain server
Systemd service
Use a Google account for unblocking videos that are not loading
Use specific fork from iv‐org YouTube.js
Z ‐ Archive ‐ Design plan
No results
5
Use specific fork from iv‐org YouTube.js
Émilien (perso) edited this page 2025-03-25 13:08:27 +01:00
Table of Contents
Description
This tutorial is for using a specific fork from iv-org/YouTube.js, like using new commits that are still not in YouTube.js itself.
- Create a new branch in https://github.com/iv-org/YouTube.js
- Update the master branch against the new commits from LuanRT/YouTube.js (can use the Sync fork button in GitHub)
- Do your things, like apply commits from an existing PR at https://github.com/LuanRT/YouTube.js
- Once your tests are correct, run these new commands:
This will create a folder called "deno".npm ci npm run build:deno
- Delete existing deno branch if it exists:
git branch -D deno
. - Create a new branch:
git switch --orphan deno
- Now create a file called
deno.ts
with this content: https://github.com/LuanRT/YouTube.js/blob/deno/deno.tswget https://github.com/iv-org/YouTube.js/raw/refs/heads/deno/deno.ts
- Add deno.ts and deno folder to git tracking, commit and push:
git add deno.ts deno/ git commit -m "changes from branch XXX" git push -f origin deno
- Go to deno.json in invidious-companion code and change the URLs from
LuanRT/YouTube.js/refs/tags/vXX.X.X-deno
toiv-org/YouTube.js/LATEST_COMMITID_FROM_DENO_BRANCH
diff --git a/deno.json b/deno.json index 02ea3a2..bb78869 100644 --- a/deno.json +++ b/deno.json @@ -6,10 +6,10 @@ "imports": { "hono": "jsr:@hono/hono@4.7.4", "@std/toml": "jsr:@std/toml@1.0.2", - "youtubei.js": "https://raw.githubusercontent.com/LuanRT/YouTube.js/refs/tags/v13.1.0-deno/deno.ts", - "youtubei.js/Utils": "https://raw.githubusercontent.com/LuanRT/YouTube.js/refs/tags/v13.1.0-deno/deno/src/utils/Utils.ts", - "youtubei.js/NavigationEndpoint": "https://raw.githubusercontent.com/LuanRT/YouTube.js/refs/tags/v13.1.0-deno/deno/src/parser/classes/NavigationEndpoint.ts", - "youtubei.js/PlayerCaptionsTracklist": "https://raw.githubusercontent.com/LuanRT/YouTube.js/refs/tags/v13.1.0-deno/deno/src/parser/classes/PlayerCaptionsTracklist.ts", + "youtubei.js": "https://raw.githubusercontent.com/iv-org/YouTube.js/LATEST_COMMITID_FROM_DENO_BRANCH/deno.ts", + "youtubei.js/Utils": "https://raw.githubusercontent.com/iv-org/YouTube.js/LATEST_COMMITID_FROM_DENO_BRANCH/deno/src/utils/Utils.ts", + "youtubei.js/NavigationEndpoint": "https://raw.githubusercontent.com/iv-org/YouTube.js/LATEST_COMMITID_FROM_DENO_BRANCH/deno/src/parser/classes/NavigationEndpoint.ts", + "youtubei.js/PlayerCaptionsTracklist": "https://raw.githubusercontent.com/iv-org/YouTube.js/LATEST_COMMITID_FROM_DENO_BRANCH/deno/src/parser/classes/PlayerCaptionsTracklist.ts", "jsdom": "npm:jsdom@26.0.0", "bgutils": "https://esm.sh/bgutils-js@3.2.0", "estree": "https://esm.sh/@types/estree@1.0.6",
- Update deno.lock using:
SERVER_SECRET_KEY=yoh3deiSh3Aih1iw deno task dev deno check src/**
- Create a PR for these changes and merge it if it's working great.
Once the changes are upstreamed to YouTube.js, please revert to YouTube.js repo.