Steam advance Downloads links in store

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

当前为 2023-06-18 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Steam advance Downloads links in store
// @namespace    Wizzergod
// @author       Wizzergod
// @license      MIT
// @license:2    CC BY-NC-SA 4.0
// @version      1.0.1
// @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.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 = '80px';
    gameLinksDiv.style.marginBottom = '65px';
 
    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 = '100px';
    gamePurchaseAction.style.top = '70px';
 
    var gamePurchaseActionBg = document.createElement('div');
    gamePurchaseActionBg.className = 'game_purchase_action_bg';
    gamePurchaseActionBg.style.height = '96px';
 
    var titleElement = document.querySelector('#appHubAppName .apphub_AppName, span[itemprop="name"]');
    var gameTitleText = (titleElement ? titleElement.textContent.trim() : '');
 
    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.lol');
    var link6 = createGameLink('https://1337x.to/search/' + encodeURIComponent(gameTitleText) + '/1/', '1337x.to');
    var link7 = createGameLink('https://thepiratebay.org/search.php?cat=401&q=' + encodeURIComponent(gameTitleText), 'thepiratebay.org');
    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 linkArray = [link1, link2, link3, link4, link5, link6, link7, link8, link9];
 
    var rows = Math.ceil(linkArray.length / 3); // Вычисляем количество строк
 
    for (var i = 0; i < rows; i++) {
        var row = document.createElement('div');
        row.style.display = 'flex';
 
        for (var j = i * 3; j < i * 3 + 3 && j < linkArray.length; j++) {
            row.appendChild(linkArray[j]);
        }
 
        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]);
    }
 
})();