Greasy Fork is available in English.

Freeship

Unlock all Fireship PRO courses/lessons.

Fra 30.11.2024. Se den seneste versjonen.

  1. // ==UserScript==
  2. // @name Freeship
  3. // @namespace lemons
  4. // @version 1.11
  5. // @description Unlock all Fireship PRO courses/lessons.
  6. // @author lemons
  7. // @match https://fireship.io/*
  8. // @icon https://em-content.zobj.net/source/apple/391/fire_1f525.png
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. async function unlock() {
  13. document.querySelectorAll("[free=\"\"]").forEach(el => el.setAttribute("free", true)) // set all elements with the attribute free set to "" to true
  14.  
  15. if (document.querySelector("if-access [slot=\"granted\"]")) { // replace HOW TO ENROLL to YOU HAVE ACCESS
  16. document.querySelector("if-access [slot=\"denied\"]").remove()
  17. document.querySelector("if-access [slot=\"granted\"]").setAttribute("slot", "denied")
  18. }
  19.  
  20. if (document.querySelector("video-player")?.shadowRoot?.querySelector(".vid")?.innerHTML) return; // return if no video player
  21. const decoded = atob(atob(document.querySelector("global-data").vimeo).split("=").pop()).split("\u0088")[0];
  22. let vimeoId = "";
  23. if (decoded.includes("/")) {
  24. vimeoId = Number(atob(atob(document.querySelector("global-data").vimeo).split("=").pop()).split("\u0088")[0].split("/").pop());
  25. } else {
  26. vimeoId = Number(atob(atob(document.querySelector("global-data").vimeo).split("=").pop()).split("\u0088")[0])
  27. }
  28. const youtubeId = atob(document.querySelector("global-data").youtube); // get id for youtube video
  29.  
  30. if (youtubeId) { // if there is an id,
  31. document.querySelector("video-player").setAttribute("free", true) // set free to true
  32. 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>` // set video
  33. return;
  34. }
  35. if (vimeoId) { // if there is an id,
  36. document.querySelector("video-player").setAttribute("free", true) // set free to true
  37. const html = (await fetch(`https://vimeo.com/api/oembed.json?url=https%3A%2F%2Fvimeo.com%2F${vimeoId}&id=${vimeoId}`).then(r=>r.json())).html
  38. document.querySelector("video-player").shadowRoot.querySelector(".vid").innerHTML = html // set video
  39. return;
  40. }
  41. }
  42.  
  43. window.onload = unlock();
  44. window.addEventListener("flamethrower:router:end", unlock)