Skip to content

Instantly share code, notes, and snippets.

@Eptun
Last active March 11, 2024 21:03
Show Gist options
  • Save Eptun/3fdcc84552e75e452731cd4621c535e9 to your computer and use it in GitHub Desktop.
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>`);
})();
@sheeit
Copy link

sheeit commented Nov 4, 2018

Re-write with no jQuery:

// ==UserScript==
// @name	EmuParadise Download Workaround - 0.0.1
// @version	0.0.1
// @description	Replaces the download button link with a working one
// @author	strupo (based on Epton (https://gist.github.com/Eptun/3fdcc84552e75e452731cd4621c535e9/))
// @match	https://www.emuparadise.me/*/*/*
// @grant	none
// ==/UserScript==

(function() {
	'use strict';

	var id = encodeURIComponent(((document.URL).split('/'))[5]);
	var suf = '<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 />';
	Array.from(
		document.getElementsByClassName('download-link')
	).map(dl => {
		dl.innerHTML = suf + dl.innerHTML;
	});
})();

@xivchrixx
Copy link

uhm sir why this wont work it only open to new tab

@BlckMlr757
Copy link

Worked perfectly thanks man!

@xivchrixx
If you have Chrome/Firefox install an addon called tamper monkey, select tampermonkey and go to the dashboard to ensure it installed may need to refresh tampermonkys dashboard page after, and then click the "RAW" button on here to get it to install to tampermonkey and you should be able to download again.

@boquetipo
Copy link

Hi, the script works great except when there is more than one link.
For instance: https://www.emuparadise.me/Sega_Dreamcast_ISOs/Bangai-O_(Europe)(En,Fr,De)/51555

Sega DC games has CDI and GDI isos, and I think there is something left in the download link. I tested with a sufix, but it doesn't work.

@Xirious
Copy link

Xirious commented May 7, 2019

Hi, the script works great except when there is more than one link.

Any fix for this yet?

@timmy30274
Copy link

i know nothing about coding but made a github acct to ask a question:

i know it's 9/12/2019 but does anyone know what firefox version i need for it to work?

my firefox updated to 69.0 and the workaround no longer works.

i can go to filehippo.com and downgrade to a earlier version, all the way to version 1.0 released Dec 21 2004 (14 years 8 months ago) if i wanted to.

https://filehippo.com/download_mozilla-firefox/history/

or chrome? if chrome, what is the working version of your browser?

@MaxWhite3790
Copy link

MaxWhite3790 commented Dec 5, 2019

A NOTE TO ALL USERS OF FIREFOX !!!

This script worked very well for me using version 71.0 (Check your version).

"Why didn't it work for me?"

I must admit it "didn't work" for me either.

The problem is that in Firefox, you have to do something different but simple!

Right click on "Download using the workaround script", then "Copy Link", then go to the address bar, paste the link you copied and then hit "Enter".

It worked that way for me! But, you need to do exactly like this. Please, don't try to be smart and try something new. It's not gonna work!

Nothing while Chrome.

@emuparadise4
Copy link

now a day emuparadise give new site you can easily download direct download you can visit here emuparadise

@CaelThunderwing
Copy link

i just noticed for the longest time it didnt work in Firefox but did in Chrome, its enforceing the resulting link as https in firefox, if you just copy paste that as http, it'll connect.

@sukerokushin
Copy link

is there a way to fix that behavior in firefox without changing browser settings?

@sukerokushin
Copy link

yeah i know you can just copy paste the link, thats stupid though
it should work as a clickable link without me having to do that

@Novi444ok
Copy link

Any plans for generating links on magazines and tv shows sections?

@rocknard
Copy link

rocknard commented Jun 1, 2020

use the script https://gist.github.com/smulewicz/8257eba30384a8200b2bc2158326cfb6 and edit the ip (see the coments)

@d-apps
Copy link

d-apps commented Jun 26, 2020

I tried

use the script https://gist.github.com/smulewicz/8257eba30384a8200b2bc2158326cfb6 and edit the ip (see the coments)

I tried to download some magazines, comics, but even changing the ip with this script it doesn't work, could you help me please?

@arflech
Copy link

arflech commented Jul 31, 2020

You have to build the download URL manually, because the script had used CORS but Chrome enforces it more strictly and it doesn't work from EP to the Wayback Machine anymore; my solution uses a trycatch block to give those instructions if the XHR fails.

Also, I might try to properly fork the Gist or put it in a proper GitHub repo; I made this account today just to let the people behind this script and its forks know and possibly implement the solution themselves.

@Emuparadiser
Copy link

They redirect me To epforums.org when i try To Install a Game!II have installed the workaround Script and I also use Chrome.

@Ashuraman666
Copy link

Ashuraman666 commented Dec 1, 2020

I don't think this is working anymore. I click the Download using the workaround script link, it opens a new tab for a second, closes it immediately but no download starts. Oh yeah and i'm using Chrome

@RicoSpeed
Copy link

Just spent a little time fiddling and it does work, just needs an exception added first, I'm sure this could be added to the script by some brightspark, but here's what I did:

  • Rightclicked the workaround download link, pasted into a new tab and changed from https to http, hit enter to go there.
  • Got a message from EMU about appearing to come from outside and I can still get my file, just need to add an exception, clicked on add exception
  • taken back to download links, rightclicked and copied workaround again, opened in new tab, changed https to http , hit enter and this time it worked as expected and downloaded the file.

Tried grabbing another file and had to go through same steps.

@Grikonen
Copy link

Just spent a little time fiddling and it does work, just needs an exception added first, I'm sure this could be added to the script by some brightspark, but here's what I did:

  • Rightclicked the workaround download link, pasted into a new tab and changed from https to http, hit enter to go there.
  • Got a message from EMU about appearing to come from outside and I can still get my file, just need to add an exception, clicked on add exception
  • taken back to download links, rightclicked and copied workaround again, opened in new tab, changed https to http , hit enter and this time it worked as expected and downloaded the file.

Tried grabbing another file and had to go through same steps.

^^^^ 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:

  1. I found the default workaround link but took out the "s" after "http", then entered link as usual.
  2. Installed the script from that page as usual via Tampermonkey (i then exited the whole browser and reopened it, no idea if that helps or not, force of habit).
  3. Went on EMU website. Yay the download links are back again. Tried left clicking them, it opened a new tab for barely half a second and then disappeared with no download to be seen.
  4. Tried right-clicking the link and "save as" which allowed me to save the "zip.file". However, Chrome will try and block it saying it's not secure. BUT, you can tell it to "keep" it anyway, which overrides this block. Good luck ;).

@ReclusiveEagle
Copy link

ReclusiveEagle commented Feb 25, 2021

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.

@techgearsnet7
Copy link

It wasn't working for me, so I tried a tweak through homes for hackers. It resolved my issue for the cover gamer.

@EngineeredJonas
Copy link

what ReclusiveEagle said works for me

@wolfinston85
Copy link

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!!!

@Lplumb
Copy link

Lplumb commented Apr 21, 2022

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.

@Nona9614
Copy link

Nona9614 commented Dec 18, 2023

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 clicking F12)
  • 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".

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