-
Star
(120)
You must be signed in to star a gist -
Fork
(31)
You must be signed in to fork a gist
-
-
Save Eptun/3fdcc84552e75e452731cd4621c535e9 to your computer and use it in GitHub Desktop.
// ==UserScript== | |
// @name EmuParadise Download Workaround - 1.1.1 | |
// @version 1.1.2 | |
// @description Replaces the download button link with a working one | |
// @author Eptun | |
// @match https://www.emuparadise.me/*/*/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var id = ((document.URL).split("/"))[5]; | |
$(".download-link").prepend(`<a target="_blank" href="/roms/get-download.php?gid=`+id+`&test=true" title="Download using the workaround script">Download using the workaround script</a><br><br>`); | |
})(); |
PSA on how to get this to work now
It works, just install BUT
1: Instead of clicking the "Download using the workaround script" button, right click it and click "Save Link as"
2: It will then allow you to save the zip.
Chrome will then notify you that "this zip can't be downloaded securely" (Rom downloads are stored in Http not Https so chrome loses its sh*t)
3: Next to "discard" on your download is an up arrow. Click that, then click keep. It will start downloading.
It wasn't working for me, so I tried a tweak through homes for hackers. It resolved my issue for the cover gamer.
what ReclusiveEagle said works for me
Works great!
If it just opens a new tab what you should do is right click on the "Download using the workaround script" and then click on "Save link as..." option, this will open a file explorer window asking you where you want to donwload your game; that's it!!!
If I click the workaround link it gets stuck on a blank page, if I select save content as... then the download gets stuck on 100% but never really finishes. Could be an issue due to me using opera GX but I haven't had an issue with it before so something could've changed will try with chrome.
Eptun
@Eptun I loved your workaround! As a recomendation from a Web Developer.
- Use the "location" object from the global window object. This will allow you to build the full URL path. location.origin should give to you the "https://www.emuparadaise.com" text.
- Then append the id variable at the end of this new generated text and save it to a new variable to use it in the anchor a HTML element.
- Finally add the anchor the attribute of download to force the Save as behaviour as @ReclusiveEagle mentioned.
Note: The 3rd step must be manually applied if the user is using Google Chrome. Firefox works with this method automatically.
If anything that I said was difficult I will attach the code for you!
// ==UserScript==
// @name EmuParadise Download Workaround - 1.1.1
// @version 1.1.2
// @description Replaces the download button link with a working one
// @author Eptun
// @match https://www.emuparadise.me/*/*/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @grant none
// ==/UserScript==
(function () {
"use strict";
/** The style class from the download button */
const DOWNLOAD_BUTTON_CLASS = "download-link";
/** The game id from the `emuparadise` servers */
const id = document.URL.substring(document.URL.lastIndexOf("/") + 1);
/** The link to follow when the generated button is clicked */
const href = `${location.origin}/roms/get-download.php?gid=${id}&test=true`;
/** The original download link container */
const DownloadLinkContainer = document.body.querySelector(
`.${DOWNLOAD_BUTTON_CLASS}`
);
/** The original link */
const DownloadLink = DownloadLinkContainer.querySelector("a");
/** The original text in the link */
const text = DownloadLink.innerText;
/** The original link extra text */
const extra = DownloadLinkContainer.innerText.substring(
text.length,
DownloadLinkContainer.innerText.length
);
// Modifies the text in the original link
DownloadLink.innerText = `${text} [Ignore]`;
/** The generated download link */
const WorkaroundLink = document.createElement("a");
WorkaroundLink.target = "_blank";
WorkaroundLink.href = href;
WorkaroundLink.download = text;
WorkaroundLink.title = "The link using the workaround script";
WorkaroundLink.innerText = `${text} [Repaired]`;
/** The new link container */
const WorkaroundLinkContainer = document.createElement("div");
WorkaroundLinkContainer.classList.add(DOWNLOAD_BUTTON_CLASS);
WorkaroundLinkContainer.appendChild(WorkaroundLink);
WorkaroundLinkContainer.append(extra);
// Appends the new generated link before the original link
DownloadLinkContainer.insertAdjacentElement(
"beforebegin",
WorkaroundLinkContainer
);
// Removes the original link
DownloadLinkContainer.remove();
})();
User
You don't need to install any add-on!
- Open the
Developers Tools
from the browser (ussually clickingF12
) - Then find a tab called
console
and click it. - This tab will open a text field below it, there you should paste only the code then hit enter.
- If done properly the link should be replaced with a version with an extra text
[Repaired]
. That link is the one that should be clicked. - If the link is not working is because the browser is blocking it. Try
Firefox
or if you want to use the one that blocked the link, follow the steps from @ReclusiveEagle.
Note This method should be applied just once, if at any step you feel something failed to you, reload the page and start over. Plus this method will only look for the first download link in the page. Those games that contains multple "links", those are just dead ends. Just try this method ignoring those extra "zombie links".
^^^^ Just tried what this guy did ^^^^ on up-to-date chrome settings. I can confirm it works. In basic english, what happened for me was: