Greasy Fork

Greasy Fork is available in English.

Pirate Games Links for some websites

Simply adds a pirate link to all games on the GOG store

当前为 2024-03-22 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

/* eslint-disable no-multi-spaces */
var buttonSet = [
	  { url: "https://steamrip.com/?s=",           title: "SteamRIP" },
    { url: "https://www.ovagames.com/?s=",       title: "OVA Games" },
	  { url: "https://fitgirl-repacks.site/?s=",   title: "FitGirl" },
	  { url: "https://dodi-repacks.site/?s=",      title: "DODI" },
	  { url: "https://gload.to/?s=",               title: "Gload" },
    { url: "https://search.rlsbb.ru/?s=",        title: "Release BB" },
    { url: "https://scnlog.me/?s=",              title: "SCNLOG" },
    { url: "https://cpgrepacks.site/?s=",        title: "CPG Repacks (anime games repack group)" },
    { url: "https://www.tiny-repacks.win/?s=",   title: "Tiny Repacks" },
    { url: "https://g4u.to/en/search/?str=",     title: "g4u" },
    { url: "https://fitgirl-repacks.site/?s=",   title: "Fitgirl" },
    { url: "https://gogunlocked.com/?s=",        title: "GOG Unlocked" },
];
var unsafeButtonSet = [
    { url: "https://igg-games.com/?s=",          title: "IGG" },
    { url: "https://pcgamestorrents.com/?s=",    title: "PC games Torrent" },
];
var siteSet = [
    { url: "https://www.gog.com/game/*",           title: "GOG" },
    { url: "https://www.gog.com/en/game/*",        title: "GOG" },
    { url: "https://store.steampowered.com/app/*", title: "Steam" },
//    { url: /https:\/\/igg-games.com\/.*.html/,     title: "IGG" },
];

/*
All Credit for this userscript goes to NotNeo. I simply fixed a small bug that stopped this script from working on Steam in 2019. And now I'm adding buttos for other sites
*/
// ==UserScript==
// @name         Pirate Games Links for some websites
// @namespace    Kozinc
// @author       Kozinc
// @version      0.2.4
// @description  Simply adds a pirate link to all games on the GOG store
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
// @match        https://www.gog.com/game/*
// @match        https://www.gog.com/en/game/*
// @match        https://store.steampowered.com/app/*
// @grant        none
// @grant		     GM_registerMenuCommand
// @grant		     GM_setValue
// @grant		     GM_getValue
// @grant		     GM_deleteValue
// @license      MIT
// ==/UserScript==

var siteSetResult = "";

siteSet.forEach((el) => {
    if(!!document.URL.match(el.url)) siteSetResult = el.title;
})

console.log("Games Links: ", siteSetResult);
var p = GM_getValue("enableUnsafeButtonSet", null);
if(p === "true") {
  // unsafeButtonSet
  buttonSet = [...buttonSet, ...unsafeButtonSet];
}

var appName = "";
switch(siteSetResult) {
    case "GOG":
        appName = document.getElementsByClassName("productcard-basics__title")[0].textContent;
        appName = appName.trim().replace(/[^a-zA-Z0-9 ]/g, '');
        buttonSet.forEach((el) => {
            $("button.cart-button")[0].parentElement.parentElement.append(furnishGOG(el.url+appName, el.title))
        })
        break;
    case "Steam":
        appName = document.getElementsByClassName("apphub_AppName")[0].textContent;
        appName = appName.trim().replace(/[^a-zA-Z0-9 ]/g, '');
        // $(".game_purchase_action_bg:first").css({"height": "32px"}); remove
        $(".game_purchase_action_bg:first").css({
            "height": "50px",
            "max-width": "500px",
            "text-wrap": "wrap"
        });
        buttonSet.forEach((el) => {
            $(".game_purchase_action_bg:first").append(furnishSteam(el.url+appName, el.title))
        })
        break;
    case "IGG":
        appName = $(".uk-article-title")[0].innerHTML.replace(" Free Download","");
        appName = appName.trim().replace(/[^a-zA-Z0-9 ]/g, '');
        buttonSet.forEach((el) => {
            $(".uk-article-meta")[0].append("  --  ")
            $(".uk-article-meta")[0].append(furnishIGG(el.url+appName, el.title))
        })
        break;
}

function furnishGOG(href, innerHTML) {
    let element = document.createElement("a");
    element.target= "_blank";
    element.style = "margin: 5px 0 5px 0 !important; padding: 5px 10px 5px 10px;";
    element.classList.add("button");
    //element.classList.add("button--small");
    element.classList.add("button--big");
    element.classList.add("cart-button");
    element.classList.add("ng-scope");
    element.href = href;
    element.innerHTML= innerHTML;
    return element;
}
function furnishSteam(href, innerHTML) {
    let element = document.createElement("a");
    element.target= "_blank";
    element.style = "margin-left: 10px; padding-right: 10px;";
    element.href = href;
    element.innerHTML= innerHTML;
    return element;
}
function furnishIGG(href, innerHTML) {
    let element = document.createElement("a");
    element.target= "_blank";
    element.href = href;
    element.innerHTML= innerHTML;
    return element;
}


try{ GM_registerMenuCommand = GM_registerMenuCommand || this.GM_registerMenuCommand; }catch(e){ GM_registerMenuCommand = false; }

if(p !== "true"){
  if(GM_registerMenuCommand){
    GM_registerMenuCommand('Show unsafe websites', function(){
      if(confirm('Are you sure you want to show possibly unsafe websites?\n'+
        '(It can be hidden later with this menu)')){
        GM_setValue("enableUnsafeButtonSet", "true");
        location.reload();
      }
    });
  }
} else if (GM_registerMenuCommand) {
  GM_registerMenuCommand('Hide unsafe websites', function(){
    if(confirm('Are you sure you want to hide possibly unsafe websites?\n'+
        '(It can be shown later with this menu)')){
      GM_deleteValue("enableUnsafeButtonSet");
      location.reload();
    }
  });
}