Skip to content

Instantly share code, notes, and snippets.

@jaxomal
Created October 3, 2020 04:53
Show Gist options
  • Save jaxomal/37682e06bc53a61d2df493abeaecf502 to your computer and use it in GitHub Desktop.
Save jaxomal/37682e06bc53a61d2df493abeaecf502 to your computer and use it in GitHub Desktop.
skip edpuzzle hack
let start = document.location.href.search("/assignments/") + 13;
let end = document.location.href.search("/watch");
let assignmentId = document.location.href.slice(start,end);
let getAttempt = () => {
return fetch(`https://edpuzzle.com/api/v3/assignments/${assignmentId}/attempt`, {
"headers": {
"accept": "application/json, text/plain, */*",
"accept-language": "en-US,en;q=0.9",
"cache-control": "no-cache",
"pragma": "no-cache",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-chrome-version": "85",
"x-csrf-token": "",
"x-edpuzzle-referrer": `https://edpuzzle.com/assignments/${assignmentId}/watch`,
"x-edpuzzle-web-version": __EDPUZZLE_DATA__.version
},
"referrer": "https://edpuzzle.com/",
"referrerPolicy": "strict-origin",
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "include"
}).then(re => re.json())
.then(attemptInfo => attemptInfo._id);
}
for (let i = 0; i < 50; i += 1) {
getAttempt().then(id => {
fetch(`https://edpuzzle.com/api/v4/media_attempts/${id}/watch`, {
"headers": {
"accept": "application/json, text/plain, */*",
"accept-language": "en-US,en;q=0.9",
"cache-control": "no-cache",
"content-type": "application/json",
"pragma": "no-cache",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-chrome-version": "85",
"x-csrf-token": "",
"x-edpuzzle-referrer": `https://edpuzzle.com/assignments/${assignmentId}/watch`,
"x-edpuzzle-web-version": __EDPUZZLE_DATA__.version
},
"referrer": "https://edpuzzle.com/",
"referrerPolicy": "strict-origin",
"body": `{\"timeIntervalNumber\":${i}}`,
"method": "POST",
"mode": "cors",
"credentials": "include"
});
})
}
@Irom1
Copy link

Irom1 commented Nov 16, 2020

How does this work and how do you use it?

@schoolispoo
Copy link

How does this work and how do you use it?

bookmark or javascript:javascript: if (window.location.hostname == "edpuzzle.com") {var script = document.body.appendChild(document.createElement("script")); script.src="https://cdn.jsdelivr.net/gh/ading2210/edpuzzle-answers@latest/script.js"; script.remove();} else {alert("Please run this on https://edpuzzle.com/assignments/[assignment_id]/watch")}

@YoGuapoo
Copy link

YoGuapoo commented Nov 8, 2022

so do i put that in my browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment