From 80f7ca680352672e4754af982e5f555563917c93 Mon Sep 17 00:00:00 2001 From: Clarth Date: Wed, 13 Dec 2023 22:33:53 -0500 Subject: [PATCH] Add ModDownloader.sh --- ModDownloader.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 ModDownloader.sh diff --git a/ModDownloader.sh b/ModDownloader.sh new file mode 100644 index 0000000..6e63a1b --- /dev/null +++ b/ModDownloader.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# Path to the SteamCMD executable +STEAMCMD_PATH="/home/steam/.steam/steamcmd.sh" + +# SteamCMD login details (replace with your own) +STEAM_USERNAME="user" +STEAM_PASSWORD="password" + +# Path to the text file containing workshop IDs (one ID per line) +WORKSHOP_IDS_FILE="/path/to/workshop_ids.txt" + +# Path to the directory where you want to install the workshop items +#mods will be in $INSTALL_DIR/steamapps/workshop/content/$APP_ID/$workshop_id/ +INSTALL_DIR="/home/steam/.steam/" + +# AppID for the game (replace with the appropriate AppID) +APP_ID="730" # 730 is the AppID for Counter-Strike: Global Offensive + +# Ensure the SteamCMD executable exists +if [ ! -f "$STEAMCMD_PATH" ]; then + echo "Error: SteamCMD not found at $STEAMCMD_PATH. Please provide the correct path." + exit 1 +fi + +# Loop through each workshop ID in the file +while IFS= read -r workshop_id || [ -n "$workshop_id" ]; do + # Run SteamCMD to install the workshop item + # Uncomment for user login + #"$STEAMCMD_PATH" +force_install_dir "$INSTALL_DIR" +login "$STEAM_USERNAME" "$STEAM_PASSWORD" +workshop_download_item "$APP_ID" "$workshop_id" +quit + #Anon login + "$STEAMCMD_PATH" +force_install_dir "$INSTALL_DIR" +login anonymous +workshop_download_item "$APP_ID" "$workshop_id" +quit + + # Move the downloaded item to the desired installation directory + # Don't do this, link to the mod dir with ln -s instead' + # It's easier to keep mods updated this way' + # mv -f "$INSTALL_DIR/steamapps/workshop/content/$APP_ID/$workshop_id/" "$INSTALL_DIR" + + + + echo + echo + echo + echo "Installed workshop item with ID $workshop_id" + echo + + #Rate Limit fix + sleep 5 +done < "$WORKSHOP_IDS_FILE" + + + +echo "Installation complete." + + +exit