Steam advance Downloads links in store

Steam advance Downloads links in store to search and download for free ;)

目前为 2023-07-01 提交的版本。查看 最新版本

// ==UserScript==
// @name         Steam advance Downloads links in store
// @namespace    Wizzergod
// @author       Wizzergod
// @license      MIT
// @license:2    CC BY-NC-SA 4.0
// @version      3.0.3
// @description  Steam advance Downloads links in store to search and download for free ;)
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
// @match        *://store.steampowered.*/app/*
// @match        *://steamcommunity.*/*
// @match        *://www.gog.com/*/game/*
// @match        *://store.steampowered.*/*
// @match        *://*.steampowered.*/*
// @icon         https://bit.ly/3Jj2YMu
// @grant        none
// @credits      Wizzergod
// ==/UserScript==

(function() {
    'use strict';

    function createGameLink(url, label) {
        var linkContainer = document.createElement('div');
        linkContainer.id = 'demoGameBtn';
        linkContainer.className = 'btn_addtocart';

        var link = document.createElement('a');
        link.target = '_blank';
        link.className = 'btn_green_steamui btn_medium';
//        link.className.blue = 'btn_blue_steamui btn_medium';
//        link.className.dark = 'btnv6_blue_hoverfade  btn_medium';

        link.href = url;
        link.rel = 'noopener noreferrer';

        var linkText = document.createElement('span');
        linkText.textContent = label;

        link.appendChild(linkText);
        linkContainer.appendChild(link);

        return linkContainer;
    }

    var gameLinksDiv = document.createElement('div');
    gameLinksDiv.className = 'game_area_purchase_game demo_above_purchase';
    gameLinksDiv.style.height = '130px';
    gameLinksDiv.style.marginBottom = '85px';

    var gameTitle = document.createElement('h1');
    gameTitle.textContent = 'Free download from torrents.';

    var discountCountdown = document.createElement('p');
    discountCountdown.className = 'game_purchase_discount_countdown';
    discountCountdown.textContent = 'These links lead to the search feature on specified websites';

    var gamePurchaseAction = document.createElement('div');
    gamePurchaseAction.className = 'game_purchase_action';
    gamePurchaseAction.style.overflow = 'auto';
    gamePurchaseAction.style.height = '100%';
    gamePurchaseAction.style.top = '70px';

    var gamePurchaseActionBg = document.createElement('div');
    gamePurchaseActionBg.className = 'game_purchase_action_bg';
    gamePurchaseActionBg.style.height = '160px';

    var titleElement = document.querySelector('#appHubAppName .apphub_AppName, span[itemprop="name"]');
    var gameTitleText = (titleElement ? titleElement.textContent.trim() : '');

//Another
    var link1 = createGameLink('https://rutracker.org/forum/tracker.php?nm=' + encodeURIComponent(gameTitleText), 'rutracker');
    var link2 = createGameLink('https://s1.thelastgame.club/?do=search&subaction=search&story=' + encodeURIComponent(gameTitleText), 'thelastgame.club');
    var link3 = createGameLink('https://thelastgame.ru/?s=' + encodeURIComponent(gameTitleText), 'thelastgame.ru');
    var link4 = createGameLink('https://thelastgame.org/?do=search&subaction=search&story=' + encodeURIComponent(gameTitleText), 'thelastgame.org');
    var link5 = createGameLink('https://www.limetorrents.lol/search/games/' + encodeURIComponent(gameTitleText), 'limetorrents');
    var link6 = createGameLink('https://1337x.to/search/' + encodeURIComponent(gameTitleText) + '/1/', '1337x');
    var link7 = createGameLink('https://thepiratebay.org/search.php?cat=401&q=' + encodeURIComponent(gameTitleText), 'thepiratebay');
    var link8 = createGameLink('https://www.torrentdownloads.pro/search/?search=' + encodeURIComponent(gameTitleText), 'torrentdownloads.pro');
    var link9 = createGameLink('https://www.torrentdownload.info/search?q=' + encodeURIComponent(gameTitleText), 'torrentdownload.info');
    var link10 = createGameLink('https://catorrent.org/index.php?do=search&story=' + encodeURIComponent(gameTitleText), 'catorrent');
    var link11 = createGameLink('https://nnmclub.to/forum/tracker.php?nm=' + encodeURIComponent(gameTitleText), 'nnmclub');

//Gog
    var link12 = createGameLink('https://freegogpcgames.com/?s=' + encodeURIComponent(gameTitleText), 'Gog: freegogpcgames');
        link12.firstChild.className = ' btn_blue_steamui btn_medium';
    var link13 = createGameLink('https://gogunlocked.com/?s=' + encodeURIComponent(gameTitleText), 'Gog: gogunlocked');
        link13.firstChild.className = ' btn_blue_steamui btn_medium';
    var link14 = createGameLink('https://gog-games.to/search/' + encodeURIComponent(gameTitleText), 'Gog: gog-games');
        link14.firstChild.className = ' btn_blue_steamui btn_medium';
    var link15 = createGameLink('https://www.gogdb.org/products?search=' + encodeURIComponent(gameTitleText), 'View on GogDB');
        link15.firstChild.className = ' btnv6_blue_hoverfade btn_medium';

//Forums
    var link16 = createGameLink('https://f95zone.to/search/search?keywords=' + encodeURIComponent(gameTitleText), 'Forum:f95zone');
        link16.firstChild.className = ' btnv6_blue_hoverfade btn_medium';
    var link17 = createGameLink('https://cs.rin.ru/forum//search.php?st=0&sk=t&sd=d&sr=topics&terms=any&sf=titleonly&keywords=' + encodeURIComponent(gameTitleText), 'Forum:cs.rin.ru');
        link17.firstChild.className = ' btnv6_blue_hoverfade btn_medium';

    var linkArray = [link1, link2, link3, link4, link10, link5, link6, link7, link8, link9, link11, link12, link13, link14, link15, link16, link17];



    var row = document.createElement('div');
    row.style.display = 'flex';
    row.style.flexWrap = 'wrap';
//    row.style.alignItems = 'center';

    for (var j = 0; j < linkArray.length; j++) {
    var link = linkArray[j];

    row.appendChild(link);
    }

    gamePurchaseActionBg.appendChild(row);

    gamePurchaseAction.appendChild(gamePurchaseActionBg);

    gameLinksDiv.appendChild(gameTitle);
    gameLinksDiv.appendChild(discountCountdown);
    gameLinksDiv.appendChild(gamePurchaseAction);

    var targetElement = document.querySelector('.game_area_purchase_game_wrapper');

    if (targetElement) {
        targetElement.parentNode.insertBefore(gameLinksDiv, targetElement);
    }

    var elements = document.getElementsByClassName('early_access_header');
    for (var i = 0; i < elements.length; i++) {
        elements[i].parentNode.removeChild(elements[i]);
    }

})();