No project description provided
Project description
Official repository: https://github.com/Brainicism/bgutil-ytdlp-pot-provider
BgUtils POT Provider
[!CAUTION] Providing a PO token does not guarantee bypassing 403 errors or bot checks, but it may help your traffic seem more legitimate.
A proof-of-origin token (POT) provider for yt-dlp. We use LuanRT's Botguard interfacing library to generate the token. This project was used to bypass the 'Sign in to confirm you're not a bot' message when invoking yt-dlp from an IP address flagged by YouTube. See PO Token Guide for more details.
The provider comes in two parts:
- Provider: Two options -
- (a) An HTTP server that generates the POT, and has interfaces for the plugin to retrieve data from (much faster, easy setup + docker image provided with Deno/Node.js support)
- (b) A POT generation script, and has command line options for the plugin to invoke (needs to transpile the script)
- Provider plugin: retrieves tokens from the provider and provides the token for yt-dlp using PO Token Provider Framework.
Installation
Base Requirements
-
yt-dlp
2025.05.22or above. -
If using Docker image for option (a) for the provider, the Docker runtime is required.
Otherwise, Node.js (>= 20) or Deno (>= 2.0.0) is required. You will also need git to clone the repository.
1. Set up the provider
There are two options for the provider, an always running POT generation HTTP server, and a POT generation script invoked when needed. The HTTP server option is simpler, faster, and comes with a prebuilt Docker image. You only need to choose one option.
You need to first install the repository unless you are using the Docker image for the HTTP server:
# Replace 1.3.1 with the latest version or the one that matches the plugin
git clone --single-branch --branch 1.3.1 https://github.com/Brainicism/bgutil-ytdlp-pot-provider.git
cd bgutil-ytdlp-pot-provider/server/
# If you are using Node:
npm ci
npx tsc
# Otherwise, if you want to use Deno:
deno install --allow-scripts=npm:canvas --frozen
(a) HTTP Server Option
This is a JavaScript HTTP server, on port 4416 by default. You have two options for running it: as a prebuilt Docker image, or manually as a JavaScript application.
Docker:
Port 4416 is exposed to the host system by default. Pass -p 1234:4416 in the docker run options (before the image name) to publish the server to port 1234 on the host system. Replace [OPTIONS] with the server command line options (usually this is not needed because you can use docker to publish the server to another port).
docker run --name bgutil-provider -d --init brainicism/bgutil-ytdlp-pot-provider [OPTIONS]
Our Docker image comes in two flavors: Node.js or Deno. The :latest tag defaults to Node.js, but you can specify an alternate version/flavor like so: brainicism/bgutil-ytdlp-pot-provider:1.3.1-deno. The :node tag also points to the latest Node.js image, and :deno points to the latest Deno image.
[!IMPORTANT] Note that the docker container's network is isolated from your local network by default. If you are using a local proxy server, it will not be accessible from within the container unless you pass
--net=hostas well.
Native:
Run the server with the selected JavaScript runtime with the following command, assuming you have changed into the bgutil-ytdlp-pot-provider/server directory. Replace [OPTIONS] with the server command line options. For example, replace it with --port 8080 to run the server on port 8080.
Node:
node build/main.js [OPTIONS]
Deno:
cd node_modules
deno run --allow-env --allow-net --allow-ffi=. --allow-read=. ../src/main.ts [OPTIONS]
Server Command Line Options
-p, --port <PORT>: The port on which the server listens.
(b) Generation Script Option
[!IMPORTANT] This method is NOT recommended for high concurrency usage. Every yt-dlp call incurs the overhead of spawning a new Node.js process to run the script. This method also handles cache concurrency poorly.
For this option, just make sure either node or deno is available in your PATH. Otherwise, use the yt-dlp option --js-runtimes RUNTIME:PATH to pass the path. --no-js-runtimes does NOT prevent the plugin from using the JavaScript runtime. The argument is only used to retrieve the path to the runtime.
2. Install the plugin
PyPI:
If yt-dlp is installed through pip or pipx, you can install the plugin with the following:
python3 -m pip install -U bgutil-ytdlp-pot-provider
Manual:
- Download
bgutil-ytdlp-pot-provider.zipfrom the latest release. - Install it by placing the zip into one of the yt-dlp plugin folders.
Usage
If using option (a) HTTP Server for the provider, and the default IP/port number (http://127.0.0.1:4416), you can use yt-dlp like normal 🙂.
If changing the port or IP used for the provider server, pass it to yt-dlp via base_url
--extractor-args "youtubepot-bgutilhttp:base_url=http://127.0.0.1:8080"
Note that when you pass multiple extractor arguments to one provider or extractor, they are to be separated by semicolons(;) as shown above.
If using option (b) script for the provider, with the default script location in your home directory (i.e: ~/bgutil-ytdlp-pot-provider or %USERPROFILE%\bgutil-ytdlp-pot-provider), you can also use yt-dlp like normal.
If you installed the script in a different location, pass it as the extractor argument server_home to youtube-bgutilscript for each yt-dlp call. ~ at the start of the path is automatically expanded.
--extractor-args "youtubepot-bgutilscript:server_home=/path/to/bgutil-ytdlp-pot-provider/server"
We use a cache internally for all generated tokens when option (b) script is used. You can change the TTL (time to live) for the token cache with the environment variable TOKEN_TTL (in hours, defaults to 6). It's currently impossible to use different TTLs for different token contexts (can be gvs, player, or subs, see Technical Details from the PO Token Guide).
That is, when using the script method, you can pass a TOKEN_TTL to yt-dlp to use a custom TTL for PO Tokens.
If both methods are available for use, the option (a) HTTP server method will be prioritized.
Verification
To check if the plugin was installed correctly, you should see the bgutil providers in yt-dlp's verbose output: yt-dlp -v YOUTUBE_URL.
[debug] [youtube] [pot] PO Token Providers: bgutil:http-1.3.1 (external), bgutil:script-node-1.3.1 (external), bgutil:script-deno-1.3.1 (external, unavailable)
FAQ
I'm getting errors during npm ci on Termux
For provider versions >=1.2.0, you may have issues while installing the canvas dependency on Termux. The Termux environment is missing a android_ndk_path and two packages by default. Run the following commands to setup the dependencies correctly.
mkdir ~/.gyp && echo "{'variables':{'android_ndk_path':''}}" > ~/.gyp/include.gypi
pkg install libvips xorgproto
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bgutil_ytdlp_pot_provider-1.3.1.tar.gz.
File metadata
- Download URL: bgutil_ytdlp_pot_provider-1.3.1.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
130635912e2450757438f72068b900076ac1a62d9f26a00afbe6f2ab258e8b25
|
|
| MD5 |
31276978228f83215b4ee10bcd4c68bd
|
|
| BLAKE2b-256 |
ad3ffae025f0f4f4e8c40ca24a97f618abba82ad2a221d37ac3df7d6ff705df2
|
Provenance
The following attestation bundles were made for bgutil_ytdlp_pot_provider-1.3.1.tar.gz:
Publisher:
release.yml on Brainicism/bgutil-ytdlp-pot-provider
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bgutil_ytdlp_pot_provider-1.3.1.tar.gz -
Subject digest:
130635912e2450757438f72068b900076ac1a62d9f26a00afbe6f2ab258e8b25 - Sigstore transparency entry: 1053484255
- Sigstore integration time:
-
Permalink:
Brainicism/bgutil-ytdlp-pot-provider@7608dd51ee813b48cf9a6d68c6e42cb197ce10e0 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Brainicism
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7608dd51ee813b48cf9a6d68c6e42cb197ce10e0 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file bgutil_ytdlp_pot_provider-1.3.1-py3-none-any.whl.
File metadata
- Download URL: bgutil_ytdlp_pot_provider-1.3.1-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e62b21f9b2e4479d59af87a8900387c34892e8d7fdb223f266749a90e0be22de
|
|
| MD5 |
5c4f7e842ac7312f977b04637f1b95d0
|
|
| BLAKE2b-256 |
745ec7e388dd92667cb8c1d6ebbef3bd87dd2245a388b6819cbc2bea7c01c1cb
|
Provenance
The following attestation bundles were made for bgutil_ytdlp_pot_provider-1.3.1-py3-none-any.whl:
Publisher:
release.yml on Brainicism/bgutil-ytdlp-pot-provider
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bgutil_ytdlp_pot_provider-1.3.1-py3-none-any.whl -
Subject digest:
e62b21f9b2e4479d59af87a8900387c34892e8d7fdb223f266749a90e0be22de - Sigstore transparency entry: 1053484296
- Sigstore integration time:
-
Permalink:
Brainicism/bgutil-ytdlp-pot-provider@7608dd51ee813b48cf9a6d68c6e42cb197ce10e0 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Brainicism
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7608dd51ee813b48cf9a6d68c6e42cb197ce10e0 -
Trigger Event:
workflow_dispatch
-
Statement type: