Created
September 26, 2022 13:51
-
-
Save rebane2001/a69e5a569a76f49c262e6732f14226f2 to your computer and use it in GitHub Desktop.
Old version, still works but has some glitches
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
// ==UserScript== | |
// @name Search Hobune for all videos on page | |
// @namespace hobune.stream | |
// @match https://www.youtube.com/* | |
// @grant GM_xmlhttpRequest | |
// @connect hobune.stream | |
// @version 1.0 | |
// @author Rebane | |
// @description 1/8/2021, 12:02:22 PM | |
// ==/UserScript== | |
let hobuneEndpoint = "https://hobune.stream/tpa-h/videos/"; | |
function checkVideo(vidID){ | |
GM_xmlhttpRequest ( { | |
method: 'GET', | |
url: hobuneEndpoint + vidID, | |
onload: function (vidID) { | |
return (response) => { | |
let obj = document.getElementsByClassName("timecode-" + vidID)[0]; | |
obj.innerText = (response.status == 200 ? "✔️ " : "❌ " ) + obj.innerText; | |
} | |
}(vidID) | |
} ); | |
} | |
function checkAllVideos(){ | |
setTimeout(() => { | |
document.querySelectorAll("span.ytd-thumbnail-overlay-time-status-renderer").forEach(obj => { | |
let vidID = obj.parentElement.parentElement.parentElement.href.split("=")[1]; | |
vidID = vidID.replace("&t", "").replace(/[^a-zA-Z0-9_-]/g, ""); | |
obj.classList.add("timecode-" + vidID); | |
checkVideo(vidID); | |
}); | |
}, 5000); | |
} | |
checkAllVideos(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment