Compare commits

..

No commits in common. 'master' and 'DepotDownloader_3.2.0' have entirely different histories.

@ -25,10 +25,10 @@ jobs:
env: env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup .NET Core - name: Setup .NET Core
uses: actions/setup-dotnet@v5 uses: actions/setup-dotnet@v4
- name: Build - name: Build
run: dotnet publish DepotDownloader/DepotDownloader.csproj -c ${{ matrix.configuration }} -o artifacts /p:ContinuousIntegrationBuild=true run: dotnet publish DepotDownloader/DepotDownloader.csproj -c ${{ matrix.configuration }} -o artifacts /p:ContinuousIntegrationBuild=true

@ -17,10 +17,10 @@ jobs:
env: env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup .NET Core - name: Setup .NET Core
uses: actions/setup-dotnet@v5 uses: actions/setup-dotnet@v4
- name: Configure NuGet - name: Configure NuGet
run: | run: |

@ -1,76 +0,0 @@
// This file is subject to the terms and conditions defined
// in file 'LICENSE', which is part of this source code package.
using System;
using System.Threading.Tasks;
using SteamKit2.Authentication;
namespace DepotDownloader
{
// This is practically copied from https://github.com/SteamRE/SteamKit/blob/master/SteamKit2/SteamKit2/Steam/Authentication/UserConsoleAuthenticator.cs
internal class ConsoleAuthenticator : IAuthenticator
{
/// <inheritdoc />
public Task<string> GetDeviceCodeAsync(bool previousCodeWasIncorrect)
{
if (previousCodeWasIncorrect)
{
Console.Error.WriteLine("The previous 2-factor auth code you have provided is incorrect.");
}
string code;
do
{
Console.Error.Write("STEAM GUARD! Please enter your 2-factor auth code from your authenticator app: ");
code = Console.ReadLine()?.Trim();
if (code == null)
{
break;
}
}
while (string.IsNullOrEmpty(code));
return Task.FromResult(code!);
}
/// <inheritdoc />
public Task<string> GetEmailCodeAsync(string email, bool previousCodeWasIncorrect)
{
if (previousCodeWasIncorrect)
{
Console.Error.WriteLine("The previous 2-factor auth code you have provided is incorrect.");
}
string code;
do
{
Console.Error.Write($"STEAM GUARD! Please enter the auth code sent to the email at {email}: ");
code = Console.ReadLine()?.Trim();
if (code == null)
{
break;
}
}
while (string.IsNullOrEmpty(code));
return Task.FromResult(code!);
}
/// <inheritdoc />
public Task<bool> AcceptDeviceConfirmationAsync()
{
if (ContentDownloader.Config.SkipAppConfirmation)
{
return Task.FromResult(false);
}
Console.Error.WriteLine("STEAM GUARD! Use the Steam Mobile App to confirm your sign in...");
return Task.FromResult(true);
}
}
}

@ -246,10 +246,17 @@ namespace DepotDownloader
return INVALID_MANIFEST_ID; return INVALID_MANIFEST_ID;
// Either the branch just doesn't exist, or it has a password // Either the branch just doesn't exist, or it has a password
if (string.IsNullOrEmpty(Config.BetaPassword)) var password = Config.BetaPassword;
if (string.IsNullOrEmpty(password))
{ {
Console.WriteLine($"Branch {branch} for depot {depotId} was not found, either it does not exist or it has a password."); Console.WriteLine($"Branch {branch} was not found, either it does not exist or it has a password.");
return INVALID_MANIFEST_ID; }
while (string.IsNullOrEmpty(password))
{
Console.Write($"Please enter the password for branch {branch}: ");
Config.BetaPassword = password = Console.ReadLine();
} }
if (!steam3.AppBetaPasswords.ContainsKey(branch)) if (!steam3.AppBetaPasswords.ContainsKey(branch))
@ -257,7 +264,7 @@ namespace DepotDownloader
// Submit the password to Steam now to get encryption keys // Submit the password to Steam now to get encryption keys
await steam3.CheckAppBetaPassword(appId, Config.BetaPassword); await steam3.CheckAppBetaPassword(appId, Config.BetaPassword);
if (!steam3.AppBetaPasswords.ContainsKey(branch)) if (!steam3.AppBetaPasswords.TryGetValue(branch, out var appBetaPassword))
{ {
Console.WriteLine($"Error: Password was invalid for branch {branch} (or the branch does not exist)"); Console.WriteLine($"Error: Password was invalid for branch {branch} (or the branch does not exist)");
return INVALID_MANIFEST_ID; return INVALID_MANIFEST_ID;
@ -425,7 +432,7 @@ namespace DepotDownloader
if (!await AccountHasAccess(appId, appId)) if (!await AccountHasAccess(appId, appId))
{ {
if (steam3.steamUser.SteamID.AccountType != EAccountType.AnonUser && await steam3.RequestFreeAppLicense(appId)) if (await steam3.RequestFreeAppLicense(appId))
{ {
Console.WriteLine("Obtained FreeOnDemand license for app {0}", appId); Console.WriteLine("Obtained FreeOnDemand license for app {0}", appId);
@ -542,8 +549,6 @@ namespace DepotDownloader
} }
} }
Console.WriteLine();
try try
{ {
await DownloadSteam3Async(infos).ConfigureAwait(false); await DownloadSteam3Async(infos).ConfigureAwait(false);

@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<RollForward>LatestMajor</RollForward> <RollForward>LatestMajor</RollForward>
<Version>3.4.0</Version> <Version>3.2.0</Version>
<Description>Steam Downloading Utility</Description> <Description>Steam Downloading Utility</Description>
<Authors>SteamRE Team</Authors> <Authors>SteamRE Team</Authors>
<Copyright>Copyright © SteamRE Team 2025</Copyright> <Copyright>Copyright © SteamRE Team 2025</Copyright>
@ -27,6 +27,6 @@
</PackageReference> </PackageReference>
<PackageReference Include="protobuf-net" Version="3.2.52" /> <PackageReference Include="protobuf-net" Version="3.2.52" />
<PackageReference Include="QRCoder" Version="1.6.0" /> <PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="SteamKit2" Version="3.3.0" /> <PackageReference Include="SteamKit2" Version="3.1.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -31,6 +31,5 @@ namespace DepotDownloader
public uint? LoginID { get; set; } public uint? LoginID { get; set; }
public bool UseQrCode { get; set; } public bool UseQrCode { get; set; }
public bool SkipAppConfirmation { get; set; }
} }
} }

@ -68,21 +68,21 @@ namespace DepotDownloader
var password = GetParameter<string>(args, "-password") ?? GetParameter<string>(args, "-pass"); var password = GetParameter<string>(args, "-password") ?? GetParameter<string>(args, "-pass");
ContentDownloader.Config.RememberPassword = HasParameter(args, "-remember-password"); ContentDownloader.Config.RememberPassword = HasParameter(args, "-remember-password");
ContentDownloader.Config.UseQrCode = HasParameter(args, "-qr"); ContentDownloader.Config.UseQrCode = HasParameter(args, "-qr");
ContentDownloader.Config.SkipAppConfirmation = HasParameter(args, "-no-mobile");
if (username == null) if (username == null)
{ {
if (ContentDownloader.Config.RememberPassword && !ContentDownloader.Config.UseQrCode) if (ContentDownloader.Config.RememberPassword)
{ {
Console.WriteLine("Error: -remember-password can not be used without -username or -qr."); Console.WriteLine("Error: -remember-password can not be used without -username.");
return 1; return 1;
} }
}
else if (ContentDownloader.Config.UseQrCode) if (ContentDownloader.Config.UseQrCode)
{ {
Console.WriteLine("Error: -qr can not be used with -username."); Console.WriteLine("Error: -qr can not be used without -username.");
return 1; return 1;
} }
}
ContentDownloader.Config.DownloadManifestOnly = HasParameter(args, "-manifest-only"); ContentDownloader.Config.DownloadManifestOnly = HasParameter(args, "-manifest-only");
@ -350,11 +350,6 @@ namespace DepotDownloader
{ {
if (username != null && password == null && (!ContentDownloader.Config.RememberPassword || !AccountSettingsStore.Instance.LoginTokens.ContainsKey(username))) if (username != null && password == null && (!ContentDownloader.Config.RememberPassword || !AccountSettingsStore.Instance.LoginTokens.ContainsKey(username)))
{ {
if (AccountSettingsStore.Instance.LoginTokens.ContainsKey(username))
{
Console.WriteLine($"Account \"{username}\" has stored credentials. Did you forget to specify -remember-password?");
}
do do
{ {
Console.Write("Enter account password for \"{0}\": ", username); Console.Write("Enter account password for \"{0}\": ", username);
@ -516,8 +511,6 @@ namespace DepotDownloader
Console.WriteLine(" -password <pass> - the password of the account to login to for restricted content."); Console.WriteLine(" -password <pass> - the password of the account to login to for restricted content.");
Console.WriteLine(" -remember-password - if set, remember the password for subsequent logins of this user."); Console.WriteLine(" -remember-password - if set, remember the password for subsequent logins of this user.");
Console.WriteLine(" use -username <username> -remember-password as login credentials."); Console.WriteLine(" use -username <username> -remember-password as login credentials.");
Console.WriteLine(" -qr - display a login QR code to be scanned with the Steam mobile app");
Console.WriteLine(" -no-mobile - prefer entering a 2FA code instead of prompting to accept in the Steam mobile app");
Console.WriteLine(); Console.WriteLine();
Console.WriteLine(" -dir <installdir> - the directory in which to place downloaded files."); Console.WriteLine(" -dir <installdir> - the directory in which to place downloaded files.");
Console.WriteLine(" -filelist <file.txt> - the name of a local file that contains a list of files to download (from the manifest)."); Console.WriteLine(" -filelist <file.txt> - the name of a local file that contains a list of files to download (from the manifest).");

@ -64,7 +64,7 @@ namespace DepotDownloader
var clientConfiguration = SteamConfiguration.Create(config => var clientConfiguration = SteamConfiguration.Create(config =>
config config
.WithHttpClientFactory(static purpose => HttpClientFactory.CreateHttpClient()) .WithHttpClientFactory(HttpClientFactory.CreateHttpClient)
); );
this.steamClient = new SteamClient(clientConfiguration); this.steamClient = new SteamClient(clientConfiguration);
@ -265,11 +265,6 @@ namespace DepotDownloader
if (requestCode == 0) if (requestCode == 0)
{ {
Console.WriteLine($"No manifest request code was returned for depot {depotId} from app {appId}, manifest {manifestId}"); Console.WriteLine($"No manifest request code was returned for depot {depotId} from app {appId}, manifest {manifestId}");
if (!authenticatedUser)
{
Console.WriteLine("Suggestion: Try logging in with -username as old manifests may not be available for anonymous accounts.");
}
} }
else else
{ {
@ -442,14 +437,13 @@ namespace DepotDownloader
try try
{ {
_ = AccountSettingsStore.Instance.GuardData.TryGetValue(logonDetails.Username, out var guarddata); _ = AccountSettingsStore.Instance.GuardData.TryGetValue(logonDetails.Username, out var guarddata);
authSession = await steamClient.Authentication.BeginAuthSessionViaCredentialsAsync(new AuthSessionDetails authSession = await steamClient.Authentication.BeginAuthSessionViaCredentialsAsync(new SteamKit2.Authentication.AuthSessionDetails
{ {
DeviceFriendlyName = nameof(DepotDownloader),
Username = logonDetails.Username, Username = logonDetails.Username,
Password = logonDetails.Password, Password = logonDetails.Password,
IsPersistentSession = ContentDownloader.Config.RememberPassword, IsPersistentSession = ContentDownloader.Config.RememberPassword,
GuardData = guarddata, GuardData = guarddata,
Authenticator = new ConsoleAuthenticator(), Authenticator = new UserConsoleAuthenticator(),
}); });
} }
catch (TaskCanceledException) catch (TaskCanceledException)
@ -471,8 +465,8 @@ namespace DepotDownloader
{ {
var session = await steamClient.Authentication.BeginAuthSessionViaQRAsync(new AuthSessionDetails var session = await steamClient.Authentication.BeginAuthSessionViaQRAsync(new AuthSessionDetails
{ {
DeviceFriendlyName = nameof(DepotDownloader),
IsPersistentSession = ContentDownloader.Config.RememberPassword, IsPersistentSession = ContentDownloader.Config.RememberPassword,
Authenticator = new UserConsoleAuthenticator(),
}); });
authSession = session; authSession = session;
@ -515,17 +509,11 @@ namespace DepotDownloader
if (result.NewGuardData != null) if (result.NewGuardData != null)
{ {
AccountSettingsStore.Instance.GuardData[result.AccountName] = result.NewGuardData; AccountSettingsStore.Instance.GuardData[result.AccountName] = result.NewGuardData;
if (ContentDownloader.Config.UseQrCode)
{
Console.WriteLine($"Success! Next time you can login with -username {result.AccountName} -remember-password instead of -qr.");
}
} }
else else
{ {
AccountSettingsStore.Instance.GuardData.Remove(result.AccountName); AccountSettingsStore.Instance.GuardData.Remove(result.AccountName);
} }
AccountSettingsStore.Instance.LoginTokens[result.AccountName] = result.RefreshToken; AccountSettingsStore.Instance.LoginTokens[result.AccountName] = result.RefreshToken;
AccountSettingsStore.Save(); AccountSettingsStore.Save();
} }
@ -706,14 +694,10 @@ namespace DepotDownloader
using var qrGenerator = new QRCodeGenerator(); using var qrGenerator = new QRCodeGenerator();
var qrCodeData = qrGenerator.CreateQrCode(challengeUrl, QRCodeGenerator.ECCLevel.L); var qrCodeData = qrGenerator.CreateQrCode(challengeUrl, QRCodeGenerator.ECCLevel.L);
using var qrCode = new AsciiQRCode(qrCodeData); using var qrCode = new AsciiQRCode(qrCodeData);
var qrCodeAsAsciiArt = qrCode.GetLineByLineGraphic(1, drawQuietZones: true); var qrCodeAsAsciiArt = qrCode.GetGraphic(1, drawQuietZones: false);
Console.WriteLine("Use the Steam Mobile App to sign in with this QR code:"); Console.WriteLine("Use the Steam Mobile App to sign in with this QR code:");
Console.WriteLine(qrCodeAsAsciiArt);
foreach (var line in qrCodeAsAsciiArt)
{
Console.WriteLine(line);
}
} }
} }
} }

@ -61,33 +61,14 @@ For example: `./DepotDownloader -app 730 -ugc 770604181014286929`
## Parameters ## Parameters
#### Authentication
Parameter | Description Parameter | Description
----------------------- | ----------- ----------------------- | -----------
`-username <user>` | the username of the account to login to for restricted content.
`-password <pass>` | the password of the account to login to for restricted content.
`-remember-password` | if set, remember the password for subsequent logins of this user. (Use `-username <username> -remember-password` as login credentials)
`-qr` | display a login QR code to be scanned with the Steam mobile app
`-no-mobile` | prefer entering a 2FA code instead of prompting to accept in the Steam mobile app.
`-loginid <#>` | a unique 32-bit integer Steam LogonID in decimal, required if running multiple instances of DepotDownloader concurrently.
#### Downloading
Parameter | Description
------------------------ | -----------
`-app <#>` | the AppID to download. `-app <#>` | the AppID to download.
`-depot <#>` | the DepotID to download. `-depot <#>` | the DepotID to download.
`-manifest <id>` | manifest id of content to download (requires `-depot`, default: current for branch). `-manifest <id>` | manifest id of content to download (requires `-depot`, default: current for branch).
`-ugc <#>` | the UGC ID to download. `-ugc <#>` | the UGC ID to download.
`-pubfile <#>` | the PublishedFileId to download. (Will automatically resolve to UGC id)
`-branch <branchname>` | download from specified branch if available (default: Public). `-branch <branchname>` | download from specified branch if available (default: Public).
`-branchpassword <pass>` | branch password if applicable. `-branchpassword <pass>` | branch password if applicable.
#### Download configuration
Parameter | Description
----------------------- | -----------
`-all-platforms` | downloads all platform-specific depots when `-app` is used. `-all-platforms` | downloads all platform-specific depots when `-app` is used.
`-os <os>` | the operating system for which to download the game (windows, macos or linux, default: OS the program is currently running on) `-os <os>` | the operating system for which to download the game (windows, macos or linux, default: OS the program is currently running on)
`-osarch <arch>` | the architecture for which to download the game (32 or 64, default: the host's architecture) `-osarch <arch>` | the architecture for which to download the game (32 or 64, default: the host's architecture)
@ -95,18 +76,18 @@ Parameter | Description
`-all-languages` | download all language-specific depots when `-app` is used. `-all-languages` | download all language-specific depots when `-app` is used.
`-language <lang>` | the language for which to download the game (default: english) `-language <lang>` | the language for which to download the game (default: english)
`-lowviolence` | download low violence depots when `-app` is used. `-lowviolence` | download low violence depots when `-app` is used.
`-pubfile <#>` | the PublishedFileId to download. (Will automatically resolve to UGC id)
`-username <user>` | the username of the account to login to for restricted content.
`-password <pass>` | the password of the account to login to for restricted content.
`-remember-password` | if set, remember the password for subsequent logins of this user. (Use `-username <username> -remember-password` as login credentials)
`-dir <installdir>` | the directory in which to place downloaded files. `-dir <installdir>` | the directory in which to place downloaded files.
`-filelist <file.txt>` | the name of a local file that contains a list of files to download (from the manifest). prefix file path with `regex:` if you want to match with regex. each file path should be on their own line. `-filelist <file.txt>` | the name of a local file that contains a list of files to download (from the manifest). prefix file path with `regex:` if you want to match with regex. each file path should be on their own line.
`-validate` | include checksum verification of files already downloaded. `-validate` | include checksum verification of files already downloaded.
`-manifest-only` | downloads a human readable manifest for any depots that would be downloaded. `-manifest-only` | downloads a human readable manifest for any depots that would be downloaded.
`-cellid <#>` | the overridden CellID of the content server to download from. `-cellid <#>` | the overridden CellID of the content server to download from.
`-max-downloads <#>` | maximum number of chunks to download concurrently. (default: 8). `-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. `-use-lancache` | forces downloads over the local network via a Lancache instance.
#### Other
Parameter | Description
----------------------- | -----------
`-debug` | enable verbose debug logging. `-debug` | enable verbose debug logging.
`-V` or `--version` | print version and runtime. `-V` or `--version` | print version and runtime.

Loading…
Cancel
Save