Acts as a bridge to enable requests to YouTube's internal APIs, bypassing CORS and other restrictions.
To install this extension, you need to load it as an unpacked extension in a Chromium-based browser.
- Download the latest
ytc-bridge-vX.X.X.zipfrom the releases page. - Unzip the downloaded file.
- Open your browser and navigate to the extensions page (e.g.,
chrome://extensionsoredge://extensions). - Enable "Developer mode".
- Click on "Load unpacked" and select the directory where you unzipped the files.
If you want to build the extension from the source code, follow these steps:
-
Clone the repository:
git clone https://github.com/LuanRT/ytc-bridge.git cd ytc-bridge -
Install the dependencies:
npm install
-
Build the project:
npm run build
This will create a
distdirectory containing the bundled extension files. -
Follow the steps in the Installation section, but select the root directory of the project instead of the unzipped release folder.
The extension consists of three main parts:
- Injected Script (
src/injected.ts): This script is injected into the web page and exposes awindow.proxyFetchfunction. Web applications can use this function as a replacement for the standardfetchAPI to proxy requests through the extension. - Content Script (
src/content.ts): This script acts as a message-passing bridge between the injected script (running in the web page's context) and the background script (running in the extension's context). - Background Script (
src/background.ts): This is the core of the extension. It listens for messages from the content script, performs the actualfetchrequests, and dynamically adds and removes network request rules to modify headers, ensuring the requests are accepted by YouTube's servers.
The extension also uses declarative network request rules defined in rules.json to modify headers for certain requests, which helps in bypassing origin and referer checks.
Distributed under the MIT License.