This script automates the process of deleting videos from your YouTube "Watch Later" playlist using PyAutoGUI.
- Python 3.11.10 🐍
- Python 3.11.10 🐍
With venv:
python3.11 -m venv venvWith virtualenv:
python3.11 -m pip install virtualenv
python3.11 -m virtualenv venvOn Linux/macOS:
source venv/bin/activateOn Windows:
venv\Scripts\activatepip install -r requirements.txtpython script.py-
🖼️ Image Recognition:
Uses screenshots in theimgfolder to locate and interact with UI elements (browser icon, YouTube buttons, etc). -
🔍 Region-based Search:
The script splits the screen into left and right halves to speed up image searches. -
🗂️ Automatic Tab Handling:
Automatically opens/closes tabs and navigates to your "Watch Later" playlist. -
⏱️ Timing Controls:
You can adjustsleepanddurationvalues in the code to match your PC's speed. -
🛑 Hotkey Listener:
Pressqat any time to safely stop the script. -
🖱️ Easy Customization:
Change the images in theimgfolder or tweak the logic in functions likelocate_imgandchange_to_not_availableto adapt to UI changes or other platforms.
-
🖼️ Browser Image:
Replace the browser icon image in theimgfolder with a screenshot of your browser's icon. Make sure the filename matches the value of thebrowser_imgvariable inscript.py(e.g.,brave.pngfor Brave browser). -
🔗 Playlist URL:
You can change the playlist URL by editing the value of theplaylist_urlvariable at the top of thescript.pyfile. -
⏱️ Adjust Timing:
The script usessleepanddurationvalues to wait for your PC to respond. You may need to increase or decrease these values depending on your computer's speed and internet connection. -
📌 Pin Your Browser:
For the script to work, your browser must be pinned to your taskbar.
Este script automatiza el proceso de eliminar videos de tu lista de "Ver más tarde" en YouTube usando PyAutoGUI.
- Python 3.11.10 🐍
- Python 3.11.10 🐍
Con venv:
python3.11 -m venv venvCon virtualenv:
python3.11 -m pip install virtualenv
python3.11 -m virtualenv venvEn Linux/macOS:
source venv/bin/activateEn Windows:
venv\Scripts\activatepip install -r requirements.txtpython script.py-
🖼️ Reconocimiento de Imágenes:
Usa capturas en la carpetaimgpara localizar e interactuar con elementos de la interfaz (icono del navegador, botones de YouTube, etc). -
🔍 Búsqueda por Regiones:
El script divide la pantalla en mitades izquierda y derecha para acelerar la búsqueda de imágenes. -
🗂️ Manejo Automático de Pestañas:
Abre/cierra pestañas y navega automáticamente a tu lista de "Ver más tarde". -
⏱️ Control de Tiempos:
Puedes ajustar los valores desleepydurationen el código según la velocidad de tu PC. -
🛑 Escucha de Teclas:
Presionaqen cualquier momento para detener el script de forma segura. -
🖱️ Fácil Personalización:
Cambia las imágenes en la carpetaimgo ajusta la lógica en funciones comolocate_imgychange_to_not_availablepara adaptarlo a cambios en la interfaz o a otras plataformas.
-
🖼️ Imagen del Navegador:
Reemplaza la imagen del icono de tu navegador en la carpetaimgcon una captura de pantalla del icono de tu navegador. Asegúrate de que el nombre del archivo coincida con el valor de la variablebrowser_imgenscript.py(por ejemplo,brave.pngpara el navegador Brave). -
🔗 URL de la Playlist:
Puedes cambiar la URL de la playlist que se usa modificando el valor de la variableplaylist_urlal inicio del archivoscript.py. -
⏱️ Ajusta los Tiempos:
El script utiliza valores desleepydurationpara esperar la respuesta de tu PC. Puede que necesites aumentar o disminuir estos valores dependiendo de la velocidad de tu computadora y conexión a internet. -
📌 Ancla tu Navegador:
Para que el script funcione, es indispensable que tengas tu navegador anclado a tu barra de tareas.