TubeScript-API/tools/README_PLAYWRIGHT.md
Cesar Mendivil 2923510c51 Add Playwright tools for extracting M3U8 URLs and proxy management
- Introduced `playwright_extract_m3u8.py` to extract M3U8 URLs from YouTube videos using Playwright.
- Added `README_PLAYWRIGHT.md` for usage instructions and requirements.
- Created `expand_and_test_proxies.py` to expand user-provided proxies and test their validity.
- Implemented `generate_proxy_whitelist.py` to generate a whitelist of working proxies based on testing results.
- Added sample proxy files: `user_proxies.txt` for user-defined proxies and `proxies_sample.txt` as a template.
- Generated `expanded_proxies.txt`, `whitelist.json`, and `whitelist.txt` for storing expanded and valid proxies.
- Included error handling and logging for proxy testing results.
2026-03-17 00:29:51 -07:00

984 B

Playwright extractor

Este script abre un video de YouTube con Playwright, captura peticiones de red y busca URLs M3U8/HLS. Opcionalmente exporta cookies al formato Netscape en ./data/cookies.txt.

Requisitos (host): pip install playwright python -m playwright install

Uso ejemplo (headful, usando tu perfil de Chrome): python3 tools/playwright_extract_m3u8.py --video https://www.youtube.com/watch?v=cmqVmX2UVBM --profile ~/.config/google-chrome --headless

Si no usas perfil, quita --profile y el script abrirá un contexto temporal.

Salida JSON: { "m3u8_urls": [ ... ], "cookies_file": "./data/cookies.txt", "errors": [] }

Consejos:

  • Ejecuta en el host (no en contenedor) si quieres usar tu perfil real de Chrome.
  • Si Playwright no encuentra el ejecutable del navegador, corre python -m playwright install.
  • Para usar las cookies exportadas desde la API: curl -s http://localhost:8282/cookies/status para comprobarlas.