diff --git a/__init__.py b/__init__.py index ddef60a..2e05c38 100644 --- a/__init__.py +++ b/__init__.py @@ -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": diff --git a/requirements.txt b/requirements.txt index 15b3112..e7053e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 \ No newline at end of file