AutoSkipYT
AutoSkipYT is visual desktop automation. It watches a region of your screen for a button you configure (using OpenCV template matching), clicks it when it appears, and then returns your mouse cursor to where it was — unless you moved the cursor yourself in the meantime.
The engine is generic: it can detect and click any configured on-screen target. The first use case is a "Skip Ad"-style button, but nothing in the code is specific to any particular website or application.
⚠️ You are responsible for complying with the terms of service of any software or website you interact with. AutoSkipYT is a general-purpose visual automation tool. It does not bypass, defeat, or circumvent any protection mechanism, and it ships with no copyrighted logos or screenshots.
What it does
- Captures a configurable screen region quickly with
mss. - Matches one or more template images with OpenCV's
cv2.matchTemplate. - Clicks the center of a detected match with
pyautogui. - Restores the cursor to its previous position — only when it is safe to do so.
- Applies a per-target cooldown so it does not click repeatedly.
Installation
Requires Python 3.11+.
pip install autoskipYT
On Linux, OpenCV needs a couple of system libraries:
sudo apt-get install -y libgl1 libglib2.0-0
Quick start
Command line
autoskipyt run # start the detection loop (Ctrl+C to stop)
autoskipyt test # capture one frame and report confidence per target
autoskipyt calibrate # pick a display, scan region, and capture a template
autoskipyt templates # list installed templates
autoskipyt --version
Python
from autoskipyt import AutoSkipper, Target
target = Target(
name="skip-ad",
templates=["skip-ad-dark.png", "skip-ad-light.png"],
confidence=0.86,
cooldown_seconds=3.0,
)
skipper = AutoSkipper(
targets=[target],
interval_seconds=0.4,
restore_cursor=True,
)
skipper.run()
With no arguments, AutoSkipper() uses the built-in default configuration.
Configuration
Configuration is stored as TOML in a platform-appropriate directory chosen by
platformdirs. Find the exact path
(and your template directory) by running autoskipyt templates or
autoskipyt calibrate.
interval_seconds = 0.4
confidence = 0.86
restore_cursor = true
grayscale = true
cooldown_seconds = 3.0
display = 1
[region]
left_percent = 0.55
top_percent = 0.45
width_percent = 0.45
height_percent = 0.55
[[targets]]
name = "skip-ad"
templates = ["skip-ad-dark.png", "skip-ad-light.png"]
confidence = 0.86
cooldown_seconds = 3.0
displayis a 1-based index (1is your first monitor).- The
[region]percentages are fractions of the selected display. The default scans the lower-right portion of the screen. - Scan only the smallest region you need — smaller regions are faster and use less CPU.
Templates
A template is a tightly cropped PNG of the button you want to detect.
- Take a screenshot of the button.
- Crop it to just the button (minimal surrounding background).
- Save it as a PNG.
- Put it in your user template directory (shown by
autoskipyt templates) or capture one interactively withautoskipyt calibrate.
Tips:
- Provide several templates per target (e.g. dark and light themes).
- Templates may be different sizes; each is matched independently.
- Capture templates at your own resolution and scaling for best results.
How confidence thresholds work
Each match produces a confidence score between 0.0 and 1.0 (from OpenCV's
normalized correlation). AutoSkipYT clicks only when the best match for a target
meets or exceeds that target's confidence threshold.
- Higher threshold (e.g.
0.92) → fewer false positives, more missed buttons. - Lower threshold (e.g.
0.80) → catches more variations, risks false clicks.
Use autoskipyt test to see the actual scores for your templates and tune the
threshold accordingly.
PyAutoGUI fail-safe
PyAutoGUI's fail-safe is enabled and never disabled. If automation ever
behaves unexpectedly, slam your mouse cursor into a corner of the screen to
immediately abort with a FailSafeException. This is your emergency stop.
Cursor restoration
AutoSkipYT records the cursor position before clicking, performs the click, then checks where the cursor ended up. It restores the original position only if the cursor is still at (or very near) the click location — meaning you did not touch the mouse. If you moved the cursor during the click, AutoSkipYT leaves it where you put it. Movements are effectively instantaneous.
Linux display-server limitations (important)
AutoSkipYT relies on global screen capture and global mouse control.
- X11: fully supported.
- Wayland: not supported. For security, Wayland restricts applications
from capturing arbitrary screen contents and synthesizing global input, so
mssandpyautoguicannot see the whole screen or move the global cursor.
To use AutoSkipYT on Linux, run an X11 session (often selectable as "Xorg" or "X11" on your login screen). You can check your session type with:
echo $XDG_SESSION_TYPE # "x11" works; "wayland" does not
On Windows, no special configuration is required.
Troubleshooting
- "No displays were detected" / capture fails on Linux: you are likely on
Wayland or have no
DISPLAY. Switch to an X11 session. - Nothing gets clicked: run
autoskipyt test. If confidence is below your threshold, re-crop the template, capture it at your own resolution, or lower the threshold. - It clicks the wrong place: your template probably includes too much
background, or the scan region excludes the button. Re-crop and re-check the
region with
autoskipyt calibrate. libGL.so.1import error on Linux: installlibgl1andlibglib2.0-0.- High CPU usage: increase
interval_secondsand/or shrink[region]. - The cursor keeps snapping back: set
restore_cursor = false(or pass--no-restore) if you prefer to keep the cursor at the clicked location.
Development
git clone https://github.com/your-org/autoskipyt
cd autoskipyt
python -m pip install -e ".[dev]"
ruff check .
ruff format --check .
mypy
pytest
Unit tests do not require a real display: screen capture and mouse operations are mocked, and template-matching tests use synthetic images.
License
MIT.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autoskipyt-0.1.0.tar.gz.
File metadata
- Download URL: autoskipyt-0.1.0.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b76a60fc9439cf81efa5e55877c9cf997caef74cf7390c792a214c1f67c5e6d2
|
|
| MD5 |
d078a3f0fda7b69128f94ab3848434ef
|
|
| BLAKE2b-256 |
cd51cb05e0f113c0c735681eb6a3e272a0537b1bdad8f3d6fa7a23c9b74f13f2
|
File details
Details for the file autoskipyt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: autoskipyt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d7fb36ddc83e4518e9fd68376c8b66cac1defc230c6576ac25c34779cdce415
|
|
| MD5 |
637b705e7a1d0626216e2e6b43aa7aaf
|
|
| BLAKE2b-256 |
8bdd8a39e06724d332165adf7398375f9039c1fbd52ddc1d12b8ff297c67f47c
|