BgUtils yt-dlp Proof-of-Origin Token Provider Plugin

1.3.1 · active · verified Thu Apr 16

The `bgutil-ytdlp-pot-provider` is a Python plugin for `yt-dlp` (version 1.3.1) designed to generate and provide YouTube Proof-of-Origin (POT) tokens. This aims to bypass YouTube's 'Sign in to confirm you're not a bot' messages and 403 errors when using `yt-dlp` from flagged IP addresses. The plugin acts as an interface to an external POT generation service (either a Node.js/Deno HTTP server/script or a recommended Rust HTTP server/binary). The project is actively maintained with updates often tied to changes in YouTube's bot detection mechanisms.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `yt-dlp` from Python to download a video, leveraging the `bgutil-ytdlp-pot-provider` plugin. It assumes the Rust POT Provider server is already running, which is the recommended setup. The Python code executes `yt-dlp` as a subprocess with the necessary extractor arguments to direct it to the POT provider.

# Step 1: Install and start the Rust POT Provider (recommended)
# Download the appropriate binary from https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases
# For example, for Linux x86_64:
# wget https://github.com/jim60105/bgutil-ytdlp-pot-provider-rs/releases/latest/download/bgutil-pot-linux-x86_64
# chmod +x bgutil-pot-linux-x86_64
# mv bgutil-pot-linux-x86_64 /usr/local/bin/bgutil-pot
# Start the provider (e.g., in a separate terminal or as a service):
# bgutil-pot server --port 4416

# Step 2: Install the Python plugin
# pip install -U bgutil-ytdlp-pot-provider

import subprocess
import os

# Example: Download a YouTube video using yt-dlp with the POT provider
# Ensure the Rust POT server is running on the default port 4416 or configured correctly.

def download_video_with_pot(video_url):
    try:
        # yt-dlp automatically detects and uses the running POT provider.
        # The 'youtubepot-bgutilhttp:' prefix is used by yt-dlp to specify
        # using the bgutil-ytdlp-pot-provider HTTP mode.
        command = [
            "yt-dlp",
            "--extractor-args", "youtubepot-bgutilhttp:base_url=http://127.0.0.1:4416",
            video_url
        ]
        
        print(f"Attempting to download {video_url} with POT...")
        result = subprocess.run(command, check=True, capture_output=True, text=True)
        print("Download successful!")
        print(result.stdout)
    except subprocess.CalledProcessError as e:
        print(f"Error during download: {e}")
        print(f"Stdout: {e.stdout}")
        print(f"Stderr: {e.stderr}")
    except FileNotFoundError:
        print("Error: yt-dlp command not found. Please ensure yt-dlp is installed and in your PATH.")

# Replace with your desired YouTube video URL
video_to_download = "https://www.youtube.com/watch?v=dQw4w9WgXcQ" 

download_video_with_pot(video_to_download)

view raw JSON →