I want a video in youtube playlist to skip to the next video when it reaches 2:41 seconds.
It works when I run the domain control separately, it works when I run the function separately.
It doesn't work together, why? I cannot run the function by checking the domain with window.location.href.
function generateCount(limit) {
const counterEle = document.querySelector("video");
if (counterEle.currentTime > limit) {
document
.querySelector(
"#movie_player > div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-left-controls > a.ytp-next-button.ytp-button"
)
.click();
setInterval(generateCount, 3000, limit);
}
}
if (
window.location.href ==
"https://www.youtube.com/watch?v=93qE6Z8qheA&list=PL9dIg-VwAsxZdZvuHjzTOP8-49CWpis17&index=5"
) {
generateCount(160.510023);
}
Aucun commentaire:
Enregistrer un commentaire