// ==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.7
// @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/*
// @exclude *://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.style.boxShadow = '2px 2px 15px rgba(0,0,0,0.4)';
link.style.margin = '1px';
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 = '210px';
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, and remember piracy is bad if you downloaded, played and liked the game, then buy it, so you will thank the developers!';
var gamePurchaseAction = document.createElement('div');
gamePurchaseAction.className = 'game_purchase_action';
gamePurchaseAction.style.overflow = 'auto';
gamePurchaseAction.style.height = '209px';
gamePurchaseAction.style.top = '110px';
gamePurchaseAction.style.boxShadow = '2px 2px 15px rgba(0,0,0,0.4)';
var gamePurchaseActionBg = document.createElement('div');
gamePurchaseActionBg.className = 'game_purchase_action_bg';
gamePurchaseActionBg.style.height = '205px';
gamePurchaseActionBg.style.borderRadius = '4px';
gamePurchaseActionBg.style.backgroundColor = '#16202d';
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 link22 = createGameLink('https://igrovaya.org/?do=search&story=' + encodeURIComponent(gameTitleText), 'igrovaya');
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');
var link23 = createGameLink('https://byrut.org/?do=search&subaction=search&story=' + encodeURIComponent(gameTitleText), 'byrut');
var link18 = createGameLink('https://pcgamestorrents.com/?s=' + encodeURIComponent(gameTitleText), 'pcgamestorrents.com');
var link21 = createGameLink('https://hisgames.org/search?searchphrase=all&searchword=' + encodeURIComponent(gameTitleText), 'hisgames');
var link20 = createGameLink('https://small-games.info/?go=search&search_text=' + encodeURIComponent(gameTitleText), 'small-games.info');
link20.firstChild.className = ' btnv6_lightblue_blue btn_medium';
var link19 = createGameLink('https://www.old-games.ru/catalog/?gamename=' + encodeURIComponent(gameTitleText), 'old-games');
link19.firstChild.className = ' btnv6_lightblue_blue btn_medium';
//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, link22, link8, link9, link18, link21, link11, link23, link19, link20, link15, link16, link17, link12, link13, link14];
var row = document.createElement('div');
row.style.display = 'flex';
row.style.flexWrap = 'wrap';
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');
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]);
}
})();