Skip to content

Instantly share code, notes, and snippets.

@notmarek
Last active November 18, 2025 09:59
Show Gist options
  • Select an option

  • Save notmarek/cf158f9538829b24e3ef48c9568a6527 to your computer and use it in GitHub Desktop.

Select an option

Save notmarek/cf158f9538829b24e3ef48c9568a6527 to your computer and use it in GitHub Desktop.
{
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