mytube

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

Vous devrez installer une extension telle que Tampermonkey, Greasemonkey ou Violentmonkey pour installer ce script.

Vous devrez installer une extension telle que Tampermonkey pour installer ce script.

Vous devrez installer une extension telle que Tampermonkey ou Violentmonkey pour installer ce script.

Vous devrez installer une extension telle que Tampermonkey ou Userscripts pour installer ce script.

Vous devrez installer une extension telle que Tampermonkey pour installer ce script.

Vous devrez installer une extension de gestionnaire de script utilisateur pour installer ce script.

(J'ai déjà un gestionnaire de scripts utilisateur, laissez-moi l'installer !)

Vous devrez installer une extension telle que Stylus pour installer ce style.

Vous devrez installer une extension telle que Stylus pour installer ce style.

Vous devrez installer une extension telle que Stylus pour installer ce style.

Vous devrez installer une extension du gestionnaire de style pour utilisateur pour installer ce style.

Vous devrez installer une extension du gestionnaire de style pour utilisateur pour installer ce style.

Vous devrez installer une extension du gestionnaire de style pour utilisateur pour installer ce style.

(J'ai déjà un gestionnaire de style utilisateur, laissez-moi l'installer!)

Auteur
player27
Installations quotidiennes
0
Installations (total)
29
Notes
0 1 0
Version
2024-04-13
Créé
13/04/2024
Mis à jour
13/04/2024
Taille
1,56 ko
Licence
N/A
S'applique à

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.