Skip to content

Commit

Permalink
Updated README, fixed batchsize config
Browse files Browse the repository at this point in the history
  • Loading branch information
sh4dow committed Jun 22, 2022
1 parent ac2ac15 commit 11a1264
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 16 deletions.
44 changes: 41 additions & 3 deletions README.md
@@ -1,15 +1,53 @@
simple steam workshop downloader using steamcmd.
Simple steam workshop downloader using steamcmd.

List of supported games: https://steamdb.info/sub/17906/apps/
List of supported games for anonymous download: https://steamdb.info/sub/17906/apps/

___

## USAGE

Download the release, extract and run "downloader.exe". Enter one or more workshop URLs, then press "Download".

The files will be downloaded to the `steamcmd/steamapps/workshop/content/<appID>/<workshop ID>` folder.
The files will be downloaded to the `steamcmd/steamapps/workshop/content/<appID>/<workshop ID>` folder by default.

Collections are also supported now.

### WARNING

The first download can take several minutes, since steamcmd needs to download/update itself. After that, initiation of the download(s) should only take a few seconds.
When downloading many and/or large items, the window might stop responding while the download is ongoing.

___

### CONFIGURATION

Open the downloader.ini file with any text editor and change or add the relevant values:

#### [general] section

- `steampath` : Location of the steamcmd.exe the program should use (either relative or absolute path)
- `theme` : Color scheme to use. Currently supported are 'default', 'sdark', 'solar, black' and 'white'.
- `batchsize` : Amount of items to download per batch. Low values cause a higher overhead when downloading many items (perhaps 5s per batch), while high values may cause issues on some systems. On Windows, the highest usable value seems to be about 700. Default is 50. Should be safe to increase to 500 in most cases.
- `login` : Steam username
- `passw` : Steam password

If both `login` and `passw` are provided, it will try a non-anonymous login before downloading. When using 2FA, manual configuration of steamcmd might be neccassary.

#### [appid] sections

- `path` : Where downloaded mods for a certain game should be moved. Old versions of the mods in this location will be overwritten.

#### Example of a modified `downloader.ini`

```
[general]
steampath = steamcmd
theme = solar
batchsize = 500
login = user123
passw = 123456
[281990]
# Stellaris
path = mods
```
28 changes: 15 additions & 13 deletions downloader.py
Expand Up @@ -100,15 +100,17 @@ def download():
for appid, wid in batch:
if appid in pc or (str(appid) in cfg and 'path' in cfg[str(appid)]):
path = pc.get(appid,cfg[str(appid)]['path'])
output.insert(tk.END, "Moving file to designated output folder ...")
output.see(tk.END)
output.update()
if(os.path.exists(os.path.join(path,str(wid)))):
# already exists -> delete old version
shutil.rmtree(os.path.join(path,str(wid)))
shutil.move(modpath(steampath,appid,wid),os.path.join(path,str(wid)))
output.insert(tk.END, " DONE")
output.update()
if os.path.exists(modpath(steampath,appid,wid)):
output.insert(tk.END, "Moving "+str(wid)+" ...")
output.see(tk.END)
output.update()
if(os.path.exists(os.path.join(path,str(wid)))):
# already exists -> delete old version
shutil.rmtree(os.path.join(path,str(wid)))
shutil.move(modpath(steampath,appid,wid),os.path.join(path,str(wid)))
output.insert(tk.END, " DONE\n")
output.see(tk.END)
output.update()
pc[appid]=path
# reset state
URLinput.delete("1.0", tk.END)
Expand Down Expand Up @@ -138,19 +140,19 @@ def main():
cfg.read('downloader.ini')
# validate ini
if 'general' not in cfg:
cfg['general']={'theme': 'default', 'steampath': 'steamcmd', 'lim': 50}
cfg['general']={'theme': 'default', 'steampath': 'steamcmd', 'batchsize': '50'}
else:
if 'theme' not in cfg['general']:
cfg['general']['theme'] = 'default'
if 'steampath' not in cfg['general']:
cfg['general']['steampath'] = 'steamcmd'
if 'lim' not in cfg['general']:
cfg['general']['lim'] = 50
cfg['general']['batchsize'] = '50'

# set globals
steampath = cfg['general']['steampath']
theme = cfg['general']['theme']
lim = cfg['general']['lim']
lim = int(cfg['general']['batchsize'])
login = None
passw = None
if 'login' in cfg['general']:
Expand Down Expand Up @@ -215,7 +217,7 @@ def main():
#canvas1.create_window(250,270,window=button1)
button1.pack(padx=3,pady=3,side=tk.BOTTOM, fill=tk.X)

output = tk.Text(root, width=50, height = 20, fg=textcol, bg=bg1)
output = tk.Text(root, width=56, height = 20, fg=textcol, bg=bg1)
#canvas1.create_window(600,150,window=output)
output.pack(padx=3,pady=3,side=tk.RIGHT,fill=tk.BOTH,expand=1)

Expand Down
Binary file modified release/downloader.exe
Binary file not shown.

0 comments on commit 11a1264

Please sign in to comment.