Skip to content

Instantly share code, notes, and snippets.

@mdhruvil
Created July 18, 2024 13:04
Show Gist options
  • Save mdhruvil/b16b040c19d3f684ce2e5fa2a5ad2d39 to your computer and use it in GitHub Desktop.
Save mdhruvil/b16b040c19d3f684ce2e5fa2a5ad2d39 to your computer and use it in GitHub Desktop.
Paste this script into fireship.io console to access all courses for free
const timeOut = 1000;
setInterval(() => {
document
.querySelectorAll('[free=""]')
.forEach((el) => el.setAttribute("free", true));
if (document.querySelector('if-access [slot="granted"]')) {
document.querySelector('if-access [slot="denied"]').remove();
document
.querySelector('if-access [slot="granted"]')
.setAttribute("slot", "denied");
}
if (
document.querySelector("video-player")?.shadowRoot?.querySelector(".vid")
?.innerHTML
)
return; // return if no video player
const vimeoId = parseInt(atob(document.querySelector("global-data").vimeo));
const youtubeId = document.querySelector("global-data").youtube;
if (vimeoId) {
document.querySelector("video-player").setAttribute("free", true);
document
.querySelector("video-player")
.shadowRoot.querySelector(
".vid"
).innerHTML = `<iframe src="https://player.vimeo.com/video/${vimeoId}?quality=360p" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen="" title="${
location.pathname.split("/")[3]
}" width="426" height="240" frameborder="0"></iframe>`;
}
if (youtubeId) {
document.querySelector("video-player").setAttribute("free", true); // set free to true
document
.querySelector("video-player")
.shadowRoot.querySelector(
".vid"
).innerHTML = `<iframe src="https://youtube.com/embed/${youtubeId}" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen="" title="${
location.pathname.split("/")[3]
}" width="426" height="240" frameborder="0"></iframe>`;
}
}, timeOut);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment