Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save angelwingss/5d7e503b04a002a04710168c61040383 to your computer and use it in GitHub Desktop.
Save angelwingss/5d7e503b04a002a04710168c61040383 to your computer and use it in GitHub Desktop.

Revisions

  1. @infval infval revised this gist Aug 21, 2021. 1 changed file with 9 additions and 11 deletions.
    20 changes: 9 additions & 11 deletions emuparadise.download.user.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    // ==UserScript==
    // @name EmuParadise Download Workaround
    // @version 1.2.2
    // @version 1.2.3
    // @description Replaces the download button link with a working one
    // @author infval (Eptun)
    // @match https://www.emuparadise.me/*/*/*
    @@ -13,7 +13,7 @@

    // Others: 50.7.189.186
    const ipDownload = "50.7.92.186";
    const urlFirstPart = "http://" + ipDownload + "/happyxhJ1ACmlTrxJQpol71nBc/";
    const urlFirstPart = "http://" + ipDownload + "/happyUUKAm8913lJJnckLiePutyNak/";

    var platform = document.URL.split("/")[3];

    @@ -28,13 +28,13 @@
    // match https://www.emuparadise.me/magazine-comic-guide-scans/%NAME%/%ID%
    else if (platform == "magazine-comic-guide-scans") {
    const webArchiveURL = "https://web.archive.org/web/2016/";

    let down = document.querySelectorAll("#content > p")[0];
    down.innerHTML = "Getting Download URL...";

    let req = new XMLHttpRequest();
    req.open('GET', webArchiveURL + document.URL, false);
    req.send(null);
    let req = new XMLHttpRequest();
    req.open('GET', webArchiveURL + document.URL, false);
    req.send(null);
    if (req.status == 200) {
    let lindex = req.responseText.indexOf("Size: ");
    let findex = req.responseText.lastIndexOf("http://", lindex);
    @@ -59,14 +59,12 @@
    }
    else {
    let id = document.URL.split("/")[5];

    let downloadLink = document.getElementsByClassName("download-link")[0];
    let div = document.createElement("div");
    div.innerHTML = `<a target="_blank" href="/roms/get-download.php?gid=` + id
    + `&test=true" title="Download using the workaround script">Download using the workaround script</a>\
    (Middle-click or Right-click -> New tab/window)<br/>\
    You have to change a URL protocol to HTTP! Example: <b>https</b>://50.7.189.186/.../Mario.7z -> <b>http</b>://50.7.189.186/.../Mario.7z`;
    + `&test=true" title="Download using the workaround script">Download using the workaround script</a>`;
    downloadLink.insertBefore(div, downloadLink.firstChild);
    }

    })();
  2. @infval infval revised this gist Apr 5, 2019. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions emuparadise.download.user.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    // ==UserScript==
    // @name EmuParadise Download Workaround
    // @version 1.2.1
    // @version 1.2.2
    // @description Replaces the download button link with a working one
    // @author infval (Eptun)
    // @match https://www.emuparadise.me/*/*/*
    @@ -22,7 +22,7 @@
    for (let i = 0; i < downs.length; i++) {
    let findex = 9; // "Download X"
    let lindex = downs[i].title.lastIndexOf(" ISO");
    downs[i].href = urlFirstPart + "/Dreamcast/" + downs[i].title.slice(findex, lindex);
    downs[i].href = urlFirstPart + "Dreamcast/" + downs[i].title.slice(findex, lindex);
    }
    }
    // match https://www.emuparadise.me/magazine-comic-guide-scans/%NAME%/%ID%
    @@ -64,7 +64,8 @@
    let div = document.createElement("div");
    div.innerHTML = `<a target="_blank" href="/roms/get-download.php?gid=` + id
    + `&test=true" title="Download using the workaround script">Download using the workaround script</a>\
    (Middle-click or Right-click -> New tab/window)`;
    (Middle-click or Right-click -> New tab/window)<br/>\
    You have to change a URL protocol to HTTP! Example: <b>https</b>://50.7.189.186/.../Mario.7z -> <b>http</b>://50.7.189.186/.../Mario.7z`;
    downloadLink.insertBefore(div, downloadLink.firstChild);
    }

  3. @infval infval revised this gist Nov 27, 2018. No changes.
  4. @infval infval revised this gist Nov 25, 2018. No changes.
  5. @infval infval revised this gist Nov 25, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions emuparadise.download.user.js
    Original file line number Diff line number Diff line change
    @@ -51,10 +51,10 @@
    }[info.children[1].textContent] || "";
    // URLs with # except The Adventures Of GamePro Issue
    down.innerHTML = "Error when getting URL: " + webArchiveURL + document.URL
    + "<div>Try "
    + "<div>Try "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".cbr" + ">cbr</a> or "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".rar" + ">rar</a>"
    + "</div>";
    + "</div>";
    }
    }
    else {
  6. @infval infval revised this gist Nov 25, 2018. 1 changed file with 4 additions and 9 deletions.
    13 changes: 4 additions & 9 deletions emuparadise.download.user.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    // ==UserScript==
    // @name EmuParadise Download Workaround
    // @version 1.2
    // @version 1.2.1
    // @description Replaces the download button link with a working one
    // @author infval (Eptun)
    // @match https://www.emuparadise.me/*/*/*
    @@ -26,7 +26,6 @@
    }
    }
    // match https://www.emuparadise.me/magazine-comic-guide-scans/%NAME%/%ID%
    // URLs with # not supported, e.g. Resident Evil #01
    else if (platform == "magazine-comic-guide-scans") {
    const webArchiveURL = "https://web.archive.org/web/2016/";

    @@ -50,15 +49,11 @@
    "Gaming Comics @ Emuparadise": "may/Comics/",
    "Gaming Magazines @ Emuparadise": "may/Mags/"
    }[info.children[1].textContent] || "";
    // Good luck
    // URLs with # except The Adventures Of GamePro Issue
    down.innerHTML = "Error when getting URL: " + webArchiveURL + document.URL
    + "<div>Try "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".cbz" + ">cbz</a>, "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".cbr" + ">cbr</a>, "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".pdf" + ">pdf</a>, "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".zip" + ">zip</a>, "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".rar" + ">rar</a>, "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".7z" + ">7z </a> "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".cbr" + ">cbr</a> or "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".rar" + ">rar</a>"
    + "</div>";
    }
    }
  7. @infval infval revised this gist Nov 25, 2018. 1 changed file with 18 additions and 3 deletions.
    21 changes: 18 additions & 3 deletions emuparadise.download.user.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    // ==UserScript==
    // @name EmuParadise Download Workaround
    // @version 1.1
    // @version 1.2
    // @description Replaces the download button link with a working one
    // @author infval (Eptun)
    // @match https://www.emuparadise.me/*/*/*
    @@ -26,7 +26,7 @@
    }
    }
    // match https://www.emuparadise.me/magazine-comic-guide-scans/%NAME%/%ID%
    // URLs with # are not supported, e.g. Resident Evil #01
    // URLs with # not supported, e.g. Resident Evil #01
    else if (platform == "magazine-comic-guide-scans") {
    const webArchiveURL = "https://web.archive.org/web/2016/";

    @@ -44,7 +44,22 @@
    down.innerHTML = "<a href=" + urlFirstPart + urlLastPart + ">Download</a>";
    }
    else {
    down.innerHTML = "Error when getting URL: " + webArchiveURL + document.URL;
    let info = document.querySelectorAll("#content > div[align=center]")[0];
    let filename = info.children[0].textContent.slice(0, -5); // "X Scan"
    let cat = {
    "Gaming Comics @ Emuparadise": "may/Comics/",
    "Gaming Magazines @ Emuparadise": "may/Mags/"
    }[info.children[1].textContent] || "";
    // Good luck
    down.innerHTML = "Error when getting URL: " + webArchiveURL + document.URL
    + "<div>Try "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".cbz" + ">cbz</a>, "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".cbr" + ">cbr</a>, "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".pdf" + ">pdf</a>, "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".zip" + ">zip</a>, "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".rar" + ">rar</a>, "
    + "<a href=" + urlFirstPart + cat + encodeURIComponent(filename) + ".7z" + ">7z </a> "
    + "</div>";
    }
    }
    else {
  8. @infval infval revised this gist Nov 25, 2018. 1 changed file with 29 additions and 6 deletions.
    35 changes: 29 additions & 6 deletions emuparadise.download.user.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    // ==UserScript==
    // @name EmuParadise Download Workaround
    // @version 1.0
    // @version 1.1
    // @description Replaces the download button link with a working one
    // @author infval (Eptun)
    // @match https://www.emuparadise.me/*/*/*
    @@ -10,29 +10,52 @@
    // https://www.reddit.com/r/Piracy/comments/968sm6/a_script_for_easy_downloading_of_emuparadise_roms/
    (function() {
    'use strict';

    // Others: 50.7.189.186
    const ipDownload = "50.7.92.186";
    const urlFirstPart = "http://" + ipDownload + "/happyxhJ1ACmlTrxJQpol71nBc/";

    var platform = document.URL.split("/")[3];

    if (platform == "Sega_Dreamcast_ISOs") {
    let downs = document.querySelectorAll("p > a[title^=Download]");
    for (let i = 0; i < downs.length; i++) {
    let findex = 9; // "Download X"
    let lindex = downs[i].title.lastIndexOf(" ISO");
    downs[i].href = "http://" + ipDownload + "/happyxhJ1ACmlTrxJQpol71nBc/Dreamcast/" + downs[i].title.slice(findex, lindex);
    downs[i].href = urlFirstPart + "/Dreamcast/" + downs[i].title.slice(findex, lindex);
    }
    }
    // match https://www.emuparadise.me/magazine-comic-guide-scans/%NAME%/%ID%
    // URLs with # are not supported, e.g. Resident Evil #01
    else if (platform == "magazine-comic-guide-scans") {
    const webArchiveURL = "https://web.archive.org/web/2016/";

    let down = document.querySelectorAll("#content > p")[0];
    down.innerHTML = "Getting Download URL...";

    let req = new XMLHttpRequest();
    req.open('GET', webArchiveURL + document.URL, false);
    req.send(null);
    if (req.status == 200) {
    let lindex = req.responseText.indexOf("Size: ");
    let findex = req.responseText.lastIndexOf("http://", lindex);
    let urlLastPart = req.responseText.slice(findex, lindex).match(/\d+\.\d+\.\d+\.\d+\/(.*)"/)[1];
    urlLastPart = urlLastPart.replace(/ /g, "%20"); // encodeURI() changes #, e.g. Sonic - The Comic Issue No. 001 Scan
    down.innerHTML = "<a href=" + urlFirstPart + urlLastPart + ">Download</a>";
    }
    else {
    down.innerHTML = "Error when getting URL: " + webArchiveURL + document.URL;
    }
    }
    else {
    let id = document.URL.split("/")[5];

    let downloadLink = document.getElementsByClassName("download-link")[0];
    let div = document.createElement('div');
    let div = document.createElement("div");
    div.innerHTML = `<a target="_blank" href="/roms/get-download.php?gid=` + id
    + `&test=true" title="Download using the workaround script">Download using the workaround script</a>\
    (Middle-click or Right-click -> New tab/window)`;
    downloadLink.insertBefore(div, downloadLink.firstChild);
    }

    })();
    })();
  9. @infval infval created this gist Nov 20, 2018.
    38 changes: 38 additions & 0 deletions emuparadise.download.user.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    // ==UserScript==
    // @name EmuParadise Download Workaround
    // @version 1.0
    // @description Replaces the download button link with a working one
    // @author infval (Eptun)
    // @match https://www.emuparadise.me/*/*/*
    // @grant none
    // ==/UserScript==

    // https://www.reddit.com/r/Piracy/comments/968sm6/a_script_for_easy_downloading_of_emuparadise_roms/
    (function() {
    'use strict';

    // Others: 50.7.189.186
    const ipDownload = "50.7.92.186";

    var platform = document.URL.split("/")[3];

    if (platform == "Sega_Dreamcast_ISOs") {
    let downs = document.querySelectorAll("p > a[title^=Download]");
    for (let i = 0; i < downs.length; i++) {
    let findex = 9; // "Download X"
    let lindex = downs[i].title.lastIndexOf(" ISO");
    downs[i].href = "http://" + ipDownload + "/happyxhJ1ACmlTrxJQpol71nBc/Dreamcast/" + downs[i].title.slice(findex, lindex);
    }
    }
    else {
    let id = document.URL.split("/")[5];

    let downloadLink = document.getElementsByClassName("download-link")[0];
    let div = document.createElement('div');
    div.innerHTML = `<a target="_blank" href="/roms/get-download.php?gid=` + id
    + `&test=true" title="Download using the workaround script">Download using the workaround script</a>\
    (Middle-click or Right-click -> New tab/window)`;
    downloadLink.insertBefore(div, downloadLink.firstChild);
    }

    })();