Last active
November 18, 2025 09:59
-
-
Save notmarek/cf158f9538829b24e3ef48c9568a6527 to your computer and use it in GitHub Desktop.
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
| { | |
| const RestAPI = Vencord.Webpack.Common.RestAPI || Vencord.Webpack.findByProps("get", "post", "put", "del"); | |
| const regex = /(\d\d)\:(\d\d) left/gm; | |
| let stuff = document.querySelectorAll("div[id*='quest-tile']"); | |
| for (let thing of stuff) { | |
| if (thing.querySelector("div[class*='description']").innerText.includes("Watch")) { | |
| let btn = thing.querySelector("div[class*='buttonChildren'] span"); | |
| console.log(btn.innerText); | |
| if (btn.innerText.includes("left")) { | |
| let m = regex.exec(btn.innerText); | |
| let time = Number(m[1]) * 60 + Number(m[2]) + Math.random(); | |
| let quest_id = thing.id.substr(11) | |
| console.log(`Vid ${quest_id} has: ${time}s`); | |
| const endpoint = `/quests/${quest_id}/video-progress`; | |
| RestAPI.post({ | |
| url: endpoint, | |
| body: { timestamp: time } | |
| }).then(response => { | |
| console.log("✅ Progress updated:", response.body); | |
| }).catch(error => { | |
| console.error("❌ Failed:", error); | |
| }); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment