Created
August 5, 2022 17:30
-
-
Save SubhrajitPrusty/544b4e1dd90d134b87b4818a63b3a197 to your computer and use it in GitHub Desktop.
This file contains 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
// ==UserScript== | |
// @name Youtube Shorts autoscroll | |
// @version v0.0.1 | |
// @grant none | |
// @author Subhrajit Prusty | |
// @description Just auto scroll through youtube shorts | |
// @include https://www.youtube.com/shorts/* | |
// ==/UserScript== | |
(function () { | |
setInterval(function () { | |
player = document.querySelector(".html5-video-player"); | |
if (!player) { | |
console.log("======== No Active player, skipping ======= ") | |
return | |
} | |
video = player.querySelector("video") // to get video | |
down = document.querySelector("#navigation-button-down") | |
video.loop = false | |
if (video.currentTime === video.duration) { | |
actualButton = down.getElementsByClassName("style-scope ytd-shorts") | |
if (actualButton.length > 0) { | |
console.log("======== Playing next video ======= ") | |
actualButton[0].click() | |
} | |
} | |
}, 1000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment