Skip to content

Instantly share code, notes, and snippets.

@tacohitbox
Created December 13, 2021 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tacohitbox/75334a0e5b80044fae43f4bf7b177fbc to your computer and use it in GitHub Desktop.
Save tacohitbox/75334a0e5b80044fae43f4bf7b177fbc to your computer and use it in GitHub Desktop.
Userscript to download from retrogames.cc.
// ==UserScript==
// @name RetroGames.cc Downloader
// @version 1.0
// @description try to take over the world!
// @author tacohitbox
// @match https://www.retrogames.cc/*-games/*
// @icon https://www.google.com/s2/favicons?domain=retrogames.cc
// @grant none
// ==/UserScript==
if (document.querySelector(".start-game")) {
var b = document.createElement("br");
var dl = document.createElement("button");
dl.classList.add("button");
dl.classList.add("large");
dl.innerHTML = "Download Game";
dl.onclick = function() {dlGame();}
document.querySelector(".game-container").append(b);
document.querySelector(".game-container").append(dl);
}
function dlGame() {
var s = `https:${document.querySelector(".game-container script").innerHTML.split(`'src', '`)[2].split(`').css`)[0]}`;
var x = new XMLHttpRequest();
x.open("GET", s);
x.send();
x.onload = function() {
var u = x.responseText.split(`EJS_gameUrl = '`)[1].split(`'`)[0];
window.open(u, "_self");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment