python-yt-delPlaylist/nextcloud-del.py
2023-12-23 00:50:58 +01:00

34 lines
871 B
Python

import pyautogui
import keyboard
from time import sleep
#needs opencv-python, keyboard, pyautogui (installed by pip)
delete = "d"
skip = "s"
up = "a"
while True:
if keyboard.read_key() == delete:
x, y = pyautogui.position()
# locatel and edit
x1, y2 = pyautogui.locateCenterOnScreen("edit.png")
pyautogui.moveTo(x1, y2)
pyautogui.click()
# locate and press del
sleep(0.2)
x2, y2 = pyautogui.locateCenterOnScreen("myCont.png", confidence=0.75)
pyautogui.moveTo(x2, y2)
pyautogui.click()
pyautogui.press("enter")
# move back
pyautogui.moveTo(x, y)
if keyboard.read_key() == skip:
x, y = pyautogui.position()
pyautogui.moveTo(x, y + 70)
if keyboard.read_key() == up:
x, y = pyautogui.position()
pyautogui.moveTo(x, 400)