SteamWorkshop downloader

none

当前为 2023-10-09 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==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);