From e9a5abecb74b2bf88fbcd96a2189516c676c70fe Mon Sep 17 00:00:00 2001 From: Tim Pilius Date: Fri, 8 Nov 2024 16:13:48 -0500 Subject: [PATCH 1/5] Adding support for Lancache with a new optional flag. --- DepotDownloader/DepotDownloader.csproj | 2 +- DepotDownloader/Program.cs | 14 ++++++++++++++ README.md | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/DepotDownloader/DepotDownloader.csproj b/DepotDownloader/DepotDownloader.csproj index 4a7508b3..6f5e398a 100644 --- a/DepotDownloader/DepotDownloader.csproj +++ b/DepotDownloader/DepotDownloader.csproj @@ -27,6 +27,6 @@ - + diff --git a/DepotDownloader/Program.cs b/DepotDownloader/Program.cs index ea65385b..da9a8387 100644 --- a/DepotDownloader/Program.cs +++ b/DepotDownloader/Program.cs @@ -11,6 +11,7 @@ using System.Runtime.InteropServices; using System.Text.RegularExpressions; using System.Threading.Tasks; using SteamKit2; +using SteamKit2.CDN; namespace DepotDownloader { @@ -118,6 +119,18 @@ namespace DepotDownloader ContentDownloader.Config.VerifyAll = HasParameter(args, "-verify-all") || HasParameter(args, "-verify_all") || HasParameter(args, "-validate"); ContentDownloader.Config.MaxServers = GetParameter(args, "-max-servers", 20); + + if (HasParameter(args, "-use-lancache")) + { + await Client.DetectLancacheServerAsync(); + // Increasing the number of concurrent downloads when the cache is detected since the downloads will likely + // be served much faster than over the internet. Steam internally has this behavior as well. + if (!HasParameter(args, "-max-downloads")) + { + ContentDownloader.Config.MaxDownloads = 25; + } + } + ContentDownloader.Config.MaxDownloads = GetParameter(args, "-max-downloads", 8); ContentDownloader.Config.MaxServers = Math.Max(ContentDownloader.Config.MaxServers, ContentDownloader.Config.MaxDownloads); ContentDownloader.Config.LoginID = HasParameter(args, "-loginid") ? GetParameter(args, "-loginid") : null; @@ -435,6 +448,7 @@ namespace DepotDownloader Console.WriteLine(" -max-servers <#> - maximum number of content servers to use. (default: 20)."); Console.WriteLine(" -max-downloads <#> - maximum number of chunks to download concurrently. (default: 8)."); Console.WriteLine(" -loginid <#> - a unique 32-bit integer Steam LogonID in decimal, required if running multiple instances of DepotDownloader concurrently."); + Console.WriteLine(" -use-lancache - forces downloads over the local network via a Lancache instance."); } static void PrintVersion(bool printExtra = false) diff --git a/README.md b/README.md index 12f45512..c3378b72 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ Parameter | Description `-max-servers <#>` | maximum number of content servers to use. (default: 20). `-max-downloads <#>` | maximum number of chunks to download concurrently. (default: 8). `-loginid <#>` | a unique 32-bit integer Steam LogonID in decimal, required if running multiple instances of DepotDownloader concurrently. +`-use-lancache` | forces downloads over the local network via a Lancache instance `-V` or `--version` | print version and runtime ## Frequently Asked Questions From f567a63d84408bf0f6f51100f2bcd7523b56eb29 Mon Sep 17 00:00:00 2001 From: Tim Pilius Date: Fri, 3 Jan 2025 13:28:42 -0500 Subject: [PATCH 2/5] Adding log message for when the lancache has been detected. --- DepotDownloader/Program.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/DepotDownloader/Program.cs b/DepotDownloader/Program.cs index da9a8387..98fb50d6 100644 --- a/DepotDownloader/Program.cs +++ b/DepotDownloader/Program.cs @@ -123,11 +123,16 @@ namespace DepotDownloader if (HasParameter(args, "-use-lancache")) { await Client.DetectLancacheServerAsync(); - // Increasing the number of concurrent downloads when the cache is detected since the downloads will likely - // be served much faster than over the internet. Steam internally has this behavior as well. - if (!HasParameter(args, "-max-downloads")) + if (Client.UseLancacheServer) { - ContentDownloader.Config.MaxDownloads = 25; + Console.WriteLine("Detected Lancache server! Downloads will be directed through the Lancache."); + + // Increasing the number of concurrent downloads when the cache is detected since the downloads will likely + // be served much faster than over the internet. Steam internally has this behavior as well. + if (!HasParameter(args, "-max-downloads")) + { + ContentDownloader.Config.MaxDownloads = 25; + } } } From d087678628b00e6bfcff4f5c16fec8ebab5cea75 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 4 Jan 2025 12:36:33 +0200 Subject: [PATCH 3/5] Disallow using -remember-password and -qr without -username --- DepotDownloader/Program.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/DepotDownloader/Program.cs b/DepotDownloader/Program.cs index 98fb50d6..d9d45704 100644 --- a/DepotDownloader/Program.cs +++ b/DepotDownloader/Program.cs @@ -65,6 +65,21 @@ namespace DepotDownloader ContentDownloader.Config.RememberPassword = HasParameter(args, "-remember-password"); ContentDownloader.Config.UseQrCode = HasParameter(args, "-qr"); + if (username == null) + { + if (ContentDownloader.Config.RememberPassword) + { + Console.WriteLine("Error: -remember-password can not be used without -username."); + return 1; + } + + if (ContentDownloader.Config.UseQrCode) + { + Console.WriteLine("Error: -qr can not be used without -username."); + return 1; + } + } + ContentDownloader.Config.DownloadManifestOnly = HasParameter(args, "-manifest-only"); var cellId = GetParameter(args, "-cellid", -1); From 5d0c4fb0500fac1d6f9911e9b1463a66329e9c40 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 4 Jan 2025 12:39:39 +0200 Subject: [PATCH 4/5] Bump version to 3.0.0 --- DepotDownloader/DepotDownloader.csproj | 4 ++-- README.md | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DepotDownloader/DepotDownloader.csproj b/DepotDownloader/DepotDownloader.csproj index 6f5e398a..896a0dbf 100644 --- a/DepotDownloader/DepotDownloader.csproj +++ b/DepotDownloader/DepotDownloader.csproj @@ -4,10 +4,10 @@ net9.0 true LatestMajor - 2.7.3 + 3.0.0 Steam Downloading Utility SteamRE Team - Copyright © SteamRE Team 2024 + Copyright © SteamRE Team 2025 ..\Icon\DepotDownloader.ico true true diff --git a/README.md b/README.md index c3378b72..58ff8910 100644 --- a/README.md +++ b/README.md @@ -101,3 +101,8 @@ Any connection to Steam will be closed if they share a LoginID. You can specify ### Why doesn't my password containing special characters work? Do I have to specify the password on the command line? If you pass the `-password` parameter with a password that contains special characters, you will need to escape the command appropriately for the shell you are using. You do not have to include the `-password` parameter on the command line as long as you include a `-username`. You will be prompted to enter your password interactively. + +### I am getting error 401 or no manifest code returned for old manifest ids +Try logging in with a Steam account, this may happen when using anonymous account. + +Steam allows developers to block downloading old manifests, in which case no manifest code is returned even when parameters appear correct. From 17d399658827ca313c5a73260380b44221ab64f3 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 4 Jan 2025 13:03:53 +0200 Subject: [PATCH 5/5] Add `-branchpassword`, change `-beta` to `-branch` in help text --- DepotDownloader/Program.cs | 6 +++--- README.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DepotDownloader/Program.cs b/DepotDownloader/Program.cs index d9d45704..b6de42a0 100644 --- a/DepotDownloader/Program.cs +++ b/DepotDownloader/Program.cs @@ -241,7 +241,7 @@ namespace DepotDownloader #region App downloading var branch = GetParameter(args, "-branch") ?? GetParameter(args, "-beta") ?? ContentDownloader.DEFAULT_BRANCH; - ContentDownloader.Config.BetaPassword = GetParameter(args, "-betapassword"); + ContentDownloader.Config.BetaPassword = GetParameter(args, "-branchpassword") ?? GetParameter(args, "-betapassword"); ContentDownloader.Config.DownloadAllPlatforms = HasParameter(args, "-all-platforms"); @@ -440,8 +440,8 @@ namespace DepotDownloader Console.WriteLine(" -app <#> - the AppID to download."); Console.WriteLine(" -depot <#> - the DepotID to download."); Console.WriteLine(" -manifest - manifest id of content to download (requires -depot, default: current for branch)."); - Console.WriteLine($" -beta - download from specified branch if available (default: {ContentDownloader.DEFAULT_BRANCH})."); - Console.WriteLine(" -betapassword - branch password if applicable."); + Console.WriteLine($" -branch - download from specified branch if available (default: {ContentDownloader.DEFAULT_BRANCH})."); + Console.WriteLine(" -branchpassword - branch password if applicable."); Console.WriteLine(" -all-platforms - downloads all platform-specific depots when -app is used."); Console.WriteLine(" -all-archs - download all architecture-specific depots when -app is used."); Console.WriteLine(" -os - the operating system for which to download the game (windows, macos or linux, default: OS the program is currently running on)"); diff --git a/README.md b/README.md index 58ff8910..2856e2ca 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,8 @@ Parameter | Description `-depot <#>` | the DepotID to download. `-manifest ` | manifest id of content to download (requires `-depot`, default: current for branch). `-ugc <#>` | the UGC ID to download. -`-beta ` | download from specified branch if available (default: Public). -`-betapassword ` | branch password if applicable. +`-branch ` | download from specified branch if available (default: Public). +`-branchpassword ` | branch password if applicable. `-all-platforms` | downloads all platform-specific depots when `-app` is used. `-os ` | the operating system for which to download the game (windows, macos or linux, default: OS the program is currently running on) `-osarch ` | the architecture for which to download the game (32 or 64, default: the host's architecture)