feat: integrate bgutil-ytdlp-pot-provider to bypass YouTube PO Tokens

- Replaced contents of `requirements.txt` to strictly include core yt-dlp dependencies and the new anti-blocking tools (`bgutil-ytdlp-pot-provider` and `bgutil`).
- Added `bgutil` to the auto-installation requirement list in `__init__.py`.
- Updated the pip install command in `__init__.py` to include `bgutil-ytdlp-pot-provider`.
- Combined the new `po_token=web+bgutil` extractor argument with the existing `youtube:player_client` definitions in `build_cmd` to bypass blocking issues.
This commit is contained in:
Meisoftcoltd
2026-04-20 12:39:08 +00:00
parent ad352d886b
commit de2f4bbd6f
2 changed files with 7 additions and 3 deletions
+4 -3
View File
@@ -21,6 +21,7 @@ def install_missing_requirements():
("opencv-python", "cv2"),
("websockets", "websockets"),
("playwright", "playwright"),
("bgutil", "bgutil"),
]
missing = []
@@ -31,7 +32,7 @@ def install_missing_requirements():
if missing:
print(f"📥 ComfyUI-Ytdpl: Instalando dependencias faltantes: {missing}")
try:
subprocess.check_call([sys.executable, "-m", "pip", "install", "--quiet", *missing, "yt-dlp-ejs"])
subprocess.check_call([sys.executable, "-m", "pip", "install", "--quiet", *missing, "yt-dlp-ejs", "bgutil-ytdlp-pot-provider"])
print("✅ Dependencias instaladas correctamente.")
if "playwright" in missing:
print("📥 Instalando navegadores de Playwright...")
@@ -211,9 +212,9 @@ class YTDLPVideoDownloader:
if cookie_path_to_use:
cmd.extend(["--cookies", str(cookie_path_to_use)])
cmd.extend(["--extractor-args", "youtube:player_client=tv_downgraded,web"])
cmd.extend(["--extractor-args", "youtube:player_client=tv_downgraded,web;po_token=web+bgutil"])
else:
cmd.extend(["--extractor-args", "youtube:player_client=android,tv"])
cmd.extend(["--extractor-args", "youtube:player_client=android,tv;po_token=web+bgutil"])
# === CAMBIO: USAR NOMBRES GENÉRICOS DE NAVEGADOR PARA CURL-CFFI ===
if browser_source != "Ninguno":
+3
View File
@@ -4,3 +4,6 @@ yt-dlp-ejs # Motor para resolver el JS Challenge de YouTube
curl-cffi # Necesario para "impersonation" (Bypass HTTP 403)
websockets # Requerido por componentes internos de yt-dlp
# --- Sistema Anti-Bloqueos (PO Tokens) ---
bgutil-ytdlp-pot-provider # Plugin para evasión de bloqueos
bgutil # Motor base para resolver Botguard