SteamWorkshop downloader

none

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        SteamWorkshop downloader
// @version     0.4
// @author      vaniOK20
// @match   	*://steamcommunity.com/workshop/filedetails/?id=*
// @match       *://steamcommunity.com/sharedfiles/filedetails/?id=*
// @icon        https://www.google.com/s2/favicons?sz=64&domain=steamcommunity.com
// @description none
// @grant       none
// @namespace https://greasyfork.org/users/1192314
// ==/UserScript==
const header = document.querySelector('.game_area_purchase_game');

if (header) {
  while (header.firstChild) {
    header.firstChild.remove();
	}
}

//id
const url=window.location.href;
const url2 = url.slice(0, url.indexOf('&searchtext='));
const id = url2.replace(/\D/g, '');

//game id
const GameBut = document.querySelector('.breadcrumb_separator');
const GameButt = GameBut.nextElementSibling.getAttribute('href');
const idGame = GameButt.replace(/\D/g, '');

const b=document.createElement('div');
header.appendChild(b);
b.innerText = "Command SteamCmd:";

const characterCount = `workshop_download_item ${idGame} ${id}`.length;

const bb=document.createElement('div');
b.appendChild(bb);
bb.style="background-color: black; color: white;";
bb.style.width = `${characterCount+18}%`;
bb.innerText =`workshop_download_item ${idGame} ${id}`;


//button create
const a=document.createElement('a');
a.href="https://ggntw.com/steam/"+id;
a.innerText='Download';
a.style="margin-left: 500px;"
b.appendChild(a);