No project description provided
Project description
Official repository: https://github.com/Brainicism/bgutil-ytdlp-pot-provider
BgUtils POT Provider
A proof-of-origin token (POT) provider to be used alongside coletdjnz's POT plugin framework. We use LuanRT's Botguard interfacing library to generate the token.
This is 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 https://github.com/yt-dlp/yt-dlp-wiki/pull/40/files 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 (easy setup + docker image provided)
- (b) A POT generation script supplied via extractor arguments
- Provider plugin: uses POT plugin framework to retrieve data from the provider, allowing yt-dlp to simulate having passed the 'bot check'
Installation
[!CAUTION] This plugin is not ready for general use and is awaiting changes to be merged in yt-dlp for it to be functional. Follow https://github.com/yt-dlp/yt-dlp/pull/10648 for updates.
Default port number is 4416. If you want to change this, be sure to change it in both the provider and plugin code.
Base Requirements
If using Docker image for option (a) for the provider, the Docker runtime is required.
Otherwise, Node.js and Yarn are required. You will also need 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, and comes with a prebuilt Docker image. You only need to choose one option.
(a) HTTP Server Option
The provider is a Node.js HTTP server. You have two options of running it: as a prebuilt docker image, or manually as a node application.
Docker:
docker run --name bgutil-provider -d -p 4416:4416 brainicism/bgutil-ytdlp-pot-provider
Native:
cd server/
yarn install --frozen-lockfile
npx tsc
node build/main.js
Server Endpoints/Environment Variables
Environment Variables
- TOKEN_TTL: The time in hours for a PO token to be considered valid. While there are no definitive answers on how long a token is valid, it has been observed to be valid for atleast a couple of days. Default: 6
Endpoints
- POST /get_pot: Accepts a
visitor_data
(unauthenticated),data_sync_id
(authenticated) or an empty body in the request body. If no identifier is passed, a new unauthenticatedvisitor_data
will be generated. Returnspo_token
and the associated identifiervisit_identifier
. - POST /invalidate_caches: Resets the PO token cache, forcing new tokens to be generated on next fetch
(b) Generation Script Option
The generation script needs to be transpiled to Javascript before it can be used by the plugin.
cd server/
yarn install --frozen-lockfile
npx tsc
Make sure node
is available in your PATH
.
2. Install the plugin
PyPI:
python3 -m pip install -U bgutil-ytdlp-pot-provider
This will automatically install coletdjnz's POT plugin framework if haven't installed it yet.
Manual:
- Make sure you have coletdjnz's POT plugin framework installed already (must be at least version 0.0.2 or newer).
- Download the latest release zip from releases. Install it by placing the zip into one of the plugin folders.
Usage
If using option (a) HTTP Server for the provider, use yt-dlp like normal 🙂.
If using option (b) script for the provider, you need to pass extractor arguments including the path to the generation script for each yt-dlp call. Make sure to point to the transpiled version, server/build/generate_once.js
./yt-dlp --extractor-args "youtube:getpot_bgutil_script=/home/user/bgutil-test/bgutil-ytdlp-pot-provider/server/build/generate_once.js"
Project details
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
File details
Details for the file bgutil_ytdlp_pot_provider-0.4.0.tar.gz
.
File metadata
- Download URL: bgutil_ytdlp_pot_provider-0.4.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dc4b0f11894d863715a4426ad04217c3e047b806898dd1e51d5cd12a2325fd6 |
|
MD5 | 0d3a54359dc1faa04a5692318fd55c57 |
|
BLAKE2b-256 | 70aa38f4f8b2ca610cacadf477038561d7c5cdef1fab788e81168540add36aa3 |
File details
Details for the file bgutil_ytdlp_pot_provider-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: bgutil_ytdlp_pot_provider-0.4.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51989c52630d9ff6fc4c4927c7f2c2b3095763f9bd0ffa4ceca1a134a5be7630 |
|
MD5 | a24a7d2ebdacb3937ff1afa3c4d1c6c1 |
|
BLAKE2b-256 | eead53072fed1d2a7f618cf80d0d3692a1287602b2cf60c5f7b9e1263320593f |