diff --git a/README.md b/README.md index a51c44e..68aa899 100644 --- a/README.md +++ b/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//` folder. +The files will be downloaded to the `steamcmd/steamapps/workshop/content//` 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 +``` \ No newline at end of file diff --git a/downloader.py b/downloader.py index fcf130b..b169713 100644 --- a/downloader.py +++ b/downloader.py @@ -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) @@ -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']: @@ -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) diff --git a/release/downloader.exe b/release/downloader.exe index 00d71a3..f376581 100644 Binary files a/release/downloader.exe and b/release/downloader.exe differ