mirror of
https://github.com/SteamRE/DepotDownloader.git
synced 2026-02-04 05:31:18 +01:00
Add -no-mobile
This commit is contained in:
76
DepotDownloader/ConsoleAuthenticator.cs
Normal file
76
DepotDownloader/ConsoleAuthenticator.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,5 +31,6 @@ namespace DepotDownloader
|
||||
public uint? LoginID { get; set; }
|
||||
|
||||
public bool UseQrCode { get; set; }
|
||||
public bool SkipAppConfirmation { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ namespace DepotDownloader
|
||||
var password = GetParameter<string>(args, "-password") ?? GetParameter<string>(args, "-pass");
|
||||
ContentDownloader.Config.RememberPassword = HasParameter(args, "-remember-password");
|
||||
ContentDownloader.Config.UseQrCode = HasParameter(args, "-qr");
|
||||
ContentDownloader.Config.SkipAppConfirmation = HasParameter(args, "-no-mobile");
|
||||
|
||||
if (username == null)
|
||||
{
|
||||
@@ -511,6 +512,7 @@ namespace DepotDownloader
|
||||
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(" -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(" -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).");
|
||||
|
||||
@@ -449,7 +449,7 @@ namespace DepotDownloader
|
||||
Password = logonDetails.Password,
|
||||
IsPersistentSession = ContentDownloader.Config.RememberPassword,
|
||||
GuardData = guarddata,
|
||||
Authenticator = new UserConsoleAuthenticator(),
|
||||
Authenticator = new ConsoleAuthenticator(),
|
||||
});
|
||||
}
|
||||
catch (TaskCanceledException)
|
||||
|
||||
@@ -69,12 +69,13 @@ Parameter | Description
|
||||
`-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.
|
||||
`-depot <#>` | the DepotID to download.
|
||||
`-manifest <id>` | manifest id of content to download (requires `-depot`, default: current for branch).
|
||||
|
||||
Reference in New Issue
Block a user