YouTube: Remove Videos Based on Duration
This Tampermonkey script is designed to customize your YouTube recommendations by removing videos that are either too short or too long. It operates by scanning the videos in your YouTube recommendations and removing any that do not fall within the specified duration range.
Videos like this will be removed:
How does it work?
The script works by scanning the videos in your YouTube recommendations and removing any that are shorter than a specified minimum duration or longer than a specified maximum duration. By default, these durations are set to remove videos shorter than 1 minute and longer than 1 hour(by default max duration is disabled), but these can be easily adjusted to suit your preferences.
Customizing the Duration Thresholds
To adjust the duration thresholds, you need to modify the values of minDuration
and/or maxDuration
in the script. For instance, if you want to remove videos shorter than 2 minutes and longer than 20 minutes, you would change:
const userMinVideoDuration = 60;
const userMaxVideoDuration = 600;
to:
var minDuration = 120; // Minimum duration
var maxDuration = "1200"; // Maximum duration
Don't forget to comment out maxDuration line if you are planning to use it!
License
This project is licensed under the terms of the MIT license.