Last active
August 26, 2022 15:09
-
-
Save wlkns/90b820314d3794a57c579e4249bd539d to your computer and use it in GitHub Desktop.
YouTube Subscription Feed Fixes (Chrome Console)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Remove any YT shorts */ | |
[...document.querySelectorAll('ytd-grid-video-renderer')].filter(e => e.querySelector('[overlay-style="SHORTS"]')).forEach(e => e.remove()) | |
/* Remove any videos under 5 minutes (or whatever the number is changed to.) */ | |
const minimumVideoTimeInMinutes = 5;[...document.querySelectorAll('ytd-grid-video-renderer')].map(el => ({el, time: parseInt(el.querySelector('ytd-thumbnail-overlay-time-status-renderer')?.innerText.trim().split(":")[0], 10)})).filter(({el, time}) => isNaN(time) || time < minimumVideoTimeInMinutes).map(({el}) => el.remove()); | |
/* Remove any channels you may not want to see but remain subbed to. (add to list) */ | |
const badList = ['This Morning'];[...document.querySelectorAll('ytd-grid-video-renderer')].map(el => ({el, name: el.querySelector('ytd-channel-name')?.innerText.trim()})).filter(({name}) => badList.includes(name)).forEach(({el}) => el.remove()); | |
/* Remove any videos based on channel name/length */ | |
const badList = ['This Morning']; | |
const minimumVideoTimeInMinutes = 5; | |
[...document.querySelectorAll('ytd-grid-video-renderer')].map(el => ({el, name: el.querySelector('ytd-channel-name')?.innerText.trim(), time: parseInt(el.querySelector('ytd-thumbnail-overlay-time-status-renderer')?.innerText.trim().split(":")[0], 10)})).filter(({el, name, time}) => badList.includes(name) || isNaN(time) || time < minimumVideoTimeInMinutes).map(({el}) => el.remove()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment