AutoCLKR 1.0

User's Guide

Copyright 2021 Steven A. Brown. All Rights Reserved.

Introduction

When an ad appears in a YouTube video, the viewer is usually presented the option to skip ads by clicking on a box that says "Skip Ads" or "Skip Ad." AutoCLKR is a Windows program that monitors the screen for the appearance of that box and automatically clicks the mouse pointer on it, typically within half a second. AutoCLKR can do that while its window is minimized.


Using AutoCLKR

AutoCLKR loads templates into memory for the detected browser and screen resolution. A template is specfic to a particular YouTube video display mode, of which there are three. The first is the default view, in which the video plays in a frame in the upper-left quadrant of the screen. The second is full screen mode, in which the video occupies the entire screen, such as on a television. The third is theater mode, in which the video is centered on the screen, but with black vertical bars on the sides, and browser content displayed above and below the video. AutoCLKR requires default view and theater mode to run in a browser window that is maximized. A template is also specfic to a Skip Ads box or to a Skip Ad box. Therefore, six different templates for a given browser and screen resolution are necessary to cover every case in which a video can play. AutoCLKR can load as many as 16 templates into memory, two of each kind for full-screen and theater mode, and four of each kind for default view. However, the file Templates.bin can contain any number of templates, to accomodate other browsers and screen resolutions. From that file, AutoCLKR loads into memory templates for the browser it detects is currently running.

Rather than have a standard set of templates, AutoCLKR starts out with no templates and creates them one by one, interacting with you the user. That ensures templates are compatible with the way your computer displays videos. It also ensures that templates can be updated to work with changes in the way YouTube displays Skip Ad(s) boxes. It isn't necessary to create templates for all three display modes. For example, if you never use theater mode, but use both the default view and full screen mode, then only four templates are required. Those would be Skip Ads and Skip Ad templates for each of the two screen modes.

While a video is playing, AutoCLKR continually scans areas of the screen and compares them against the templates in memory. It can do that while minimized. If the algorithm detects a Skip Ads or Skip Ad box, AutoCLKR moves the mouse pointer to the box and clicks the left mouse button. Then it returns the cursor to the position it had before being moved. If the user switches to another browser or changes the screen resolution while AutoCLKR is running, AutoCLKR should be closed and launched again, so that the corresponding templates can be loaded into memory, or new ones can be created. If no browser is running when AutoCLKR is launched, AutoCLKR prompts the user to open the browser in which videos are viewed, in order to load the right templates.


Creating Templates

A template can be created while a YouTube video is running. Position the AutoCLKR window in an area of the screen where it will not obstruct your view of the video, and when you are ready to create a template, select the MT (Make Template) menu item. For a default view or a theater mode template, select "On next click" from the dropdown menu. The MT item on the menu bar becomes highlighted to indicate the next click of the mouse will trigger the make template routine, and AutoCLKR temporarily becomes an "always on top window" to keep you aware of that. When a Skip Ads or a Skip Ad box appears, click on it, then wait to see if the box is successfully copied to the upper-left corner of the AutoCLKR window, as in the image below. If it is, click Yes in the dialog box, and AutoCLKR will create a template, add it to a file named Templates.bin, and load that template into memory, making AutoCLKR ready to click a box like that, next time it appears. If copying the box to the window is unsuccessful, it would not have made a good template. In that case, click No and try again.

Skip Ads box copied

When an MT menu item is clicked, auto clicking is temporarily suspended so that you can wait for a Skip Ad box to appear after a Skip Ads box appears. If there tends to be insufficient time to click MT before the box appears, you can turn "Auto click" off in the File menu before clicking MT. Selecting "On second click" from the MT menu lets you switch to full-screen mode before clicking the Skip Ad(s) box. Or you can pause a video when the box appears, select "On second click," then click to resume the video before clicking the box. When creating a template, you can click on the Skip Ad(s) box as soon as it appears, but it is better to wait until a relatively dark background appears behind it in the video. Do not hover the mouse pointer over the box, waiting to click, but keep it off to the side, and move it to the box to click it. After you create templates for Skip Ads and Skip Ad boxes, AutoCLKR is ready to work for that browser, screen resolution, and video display mode.

To prevent the AutoCLKR window ever being hidden by another window, select "Always on top" from the File menu. With that option enabled, the AutoCLKR window is visible even when a video is playing in full screen mode, so "On next click" can be selected in the MT menu to create a full-screen template. The "Always on top" setting persists from one session to the next, and with that option enabled, the AutoCLKR window can still be minimized.

Sometimes more than one template is required for one condition of screen resolution, browser, video display mode, and box type. That is the case with YouTube default view, in which the video frame can be rectangular or square. A template for a rectangular frame will not work for a square frame. In that case, you can create a new template for the square frame, and it will be added to Templates.bin. Then AutoCLKR will load both templates into memory when started. Another case is when a template becomes unreliable, because the size or position of the Skip Ad(s) box on the screen is changed. A new template for that box can be created. AutoCLKR allows up to three templates for each box type for the default view, and up to two templates for each box type in full-screen mode and in theater mode. When the creation of a new template exceeds the allowed number of templates, the first or oldest template will be deleted from Templates.bin, to make room for the new template. When a new template is added, AutoCLKR copies the current Templates.bin to a file named TemplatesPREV.bin, before creating a new Templates.bin. TemplatesPREV.bin is not used by AutoCLKR but is there for reference.


Templates.bin format

This section of the User's Guide is for those curious about the format of Templates.bin, but is not necessary to read in order to use AutoCLKR. Templates.bin is a binary file consisting of a series of templates, the oldest being first in the file and the newest being last. It is located in the path C:\ProgramData\AutoCLKR\Templates.bin. The ProgramData folder is usually hidden in Windows, but it can be unhidden in File Explorer. Each template in the file has a header consisting of a 16-byte text part and a 16-byte binary part. AutoCLKR does not use the text part; it is there for reference by a person browsing the file in a hex editor. The text part identifies the browser by means of a two-letter code, followed by the screen resolution, followed by a two-letter code for the box type. Those codes are shown in the list below.

Code Browser
GC Google Chrome
ME Microsoft Edge
FF Mozilla Firefox
IE Internet Explorer
OP Opera
UK Unknown or generic

Code Box type
WS Default view, Skip Ads
WD Default view, Skip Ad
FS Full screen, Skip Ads
FD Full screen, Skip Ad
TS Theater mode, Skip Ads
TD Theater mode, Skip Ad

The rest of the template consists of image data in a proprietary format, padded with zeros to a 16-byte boundary.


Disclaimer

There is no guarantee that AutoCLKR will continute to work if YouTube alters the appearance of Skip Ads boxes or changes the means of skipping ads in videos.

THIS SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.