Skip to content

Plugin does not get loaded properly #206

Description

@VinVel

I have installed the following packages with pip (Python 3.12) on Windows 11:

$ pip list
Package                   Version
------------------------- ------------
...
bgutil-ytdlp-pot-provider 1.3.0
...
yt-dlp                    2026.2.21
yt-dlp-ejs                0.5.0

The way I use yt-dlp and this POT Provider Plugin is in a powershell script. To put it simply it calls the pot server function

function PotServer {
	try {
		Push-Location ~/bgutil-ytdlp-pot-provider/server
		deno run --no-prompt --allow-env --allow-net --allow-ffi=. --allow-read=. --allow-sys ./src/main.ts --port 8080
	} 
	finally {Pop-Location}

through this:

# Start PotServer as a background job
$POT = Start-ThreadJob -ScriptBlock ${function:PotServer}

# Wait for server to be ready
do { Start-Sleep -Seconds 1 }
until ((Test-NetConnection -ComputerName localhost -Port 8080).TcpTestSucceeded)  

Before executing this yt-dlp command:

yt-dlp -v --add-metadata -P "$Directory" "$Link" --% --cookies "~/Downloads/cookies.txt" --windows-filenames --continue -f "bv*+mergeall[format_id*='251']/bv*+ba" --audio-multistreams -S quality,vcodec:av1:vp9:h264,acodec:opus:aac --embed-chapters --embed-thumbnail --embed-subs --compat-options no-live-chat --concat-playlist never --sub-lang all --convert-subs ass --merge-output-format mkv --extractor-args "youtube:player-client=default,mweb,web_safari,tv_embedded" --extractor-args "youtubepot-bgutilhttp:base_url=http://localhost:8080"

I would expect that this is sufficient to use this POT Provider, after all I just followed the documentaion. However, I noticed that during execution there is this:

[debug] [youtube] [pot:bgutil:script-node] No server_home or script_path passed, defaulting to ~\bgutil-ytdlp-pot-provider\server
[debug] [youtube] [pot:bgutil:script-node] Script path doesn't exist: ~\bgutil-ytdlp-pot-provider\server\build\generate_once.js
[debug] [youtube] [pot:bgutil:script-deno] No server_home or script_path passed, defaulting to ~\bgutil-ytdlp-pot-provider\server
┏ ⚠️  Deno requests sys access to "osRelease".
┠─ Requested by `Deno.osRelease()` API.
┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.
┠─ Learn more at: https://docs.deno.com/go/--allow-sys
┠─ Run again with --allow-sys to bypass this prompt.
┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all sys permissions) >

Even though I specified --no-prompt and --allow-sys it still asks for sys access. So it seems to me as if yt-dlp uses it's own way of retrieving a gvs token? It does work after allowing the prompt, but it still seems to be as if the plugin isn't being used properly?

Granted all sys access.
[debug] [youtube] [pot] PO Token Providers: bgutil:http-1.3.0 (external), bgutil:script-node-1.3.0 (external, unavailable), bgutil:script-deno-1.3.0 (external)
[debug] [youtube] [pot] PO Token Cache Providers: memory
[debug] [youtube] [pot] PO Token Cache Spec Providers: webpo
[debug] [youtube] [jsc] JS Challenge Providers: bun (unavailable), deno, node (unavailable), quickjs (unavailable)
...
[debug] [youtube] JR59JZxxt5U: Retrieved a gvs PO Token for mweb client
...
[download] Resuming download at byte 8387584

Oh and when changing the port from 4416 to 8000 which I did here I also get this error:

WARNING: [youtube] [pot:bgutil:http] Error reaching GET http://127.0.0.1:4416/ping (caused by TransportError). Please make sure that the server is reachable at http://127.0.0.1:4416.

which seems to tie back to this:

[debug] [youtube] [pot:bgutil:http] No base_url provided, defaulting to http://127.0.0.1:4416

Even though I did provide a base_url.

What am I doing wrong?

(If it is of any use, my complete script is here: https://github.com/VinVel/useful-powershell-scripts/blob/main/YTDL.ps1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions