mytube

Skip youtube video ads duration < 180 seconds and banners. Tested on FIrefox

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey, Greasemonkey или Violentmonkey.

Для установки этого скрипта вам необходимо установить расширение, такое как Tampermonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Violentmonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Userscripts.

Чтобы установить этот скрипт, сначала вы должны установить расширение браузера, например Tampermonkey.

Чтобы установить этот скрипт, вы должны установить расширение — менеджер скриптов.

(у меня уже есть менеджер скриптов, дайте мне установить скрипт!)

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

(у меня уже есть менеджер стилей, дайте мне установить скрипт!)

Автор
player27
Установок в день
0
Всего установок
29
Оценки
0 1 0
Версия
2024-04-13
Создано
13.04.2024
Обновлено
13.04.2024
Размер
1,6 КБ
Лицензия
нет данных
Работает на

This JavaScript function is designed to enhance the user experience when watching YouTube videos by automatically skipping short videos and hiding various types of advertisements. Here's a breakdown of its functionality:

1. **Skipping Short Videos:**
- It targets the video player element on the webpage by selecting the element with the class ".video-stream".
- If the video player exists (`videoPlayer` is truthy) and the duration of the video is less than 180 seconds (3 minutes), the script performs the following actions:
- Pauses the video (`videoPlayer.pause()`).
- Sets the current playback time to slightly before the end of the video (`videoPlayer.currentTime = videoPlayer.duration - 0.001`), ensuring that the video is considered completed.
- Plays the video (`videoPlayer.play()`).
- Emulates a click on the video player (`videoPlayer.click()`), possibly to activate certain functionalities.
- It also attempts to skip any ads by clicking on elements with classes containing "ad-skip".

2. **Hiding Advertisements:**
- It defines an array `adWords` containing keywords commonly associated with advertisements.
- It selects all elements with classes containing "ytd" (likely YouTube elements) and iterates over them.
- For each element, it checks if its class contains any of the ad-related keywords (`adWords`). If it does and the element is currently displayed (`element.style.display !== 'none'`), it hides the element by setting its display style to "none".

3. **Interval Execution:**
- The function `mytube` is set to run repeatedly at intervals of 250 milliseconds (`setInterval(mytube, 250)`). This ensures that the function continuously monitors the page for changes and applies its modifications as needed.

Overall, this script aims to automate the process of skipping short videos and hiding advertisements on YouTube, providing a smoother and more enjoyable viewing experience for users.