From 0095d458e735a880a5d4b9904fd62872b80b2104 Mon Sep 17 00:00:00 2001 From: Archi Date: Sun, 3 Dec 2023 14:08:24 +0100 Subject: [PATCH] Handle new no requirements for API key --- ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs b/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs index dded369fb..af4d1e5d8 100644 --- a/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs +++ b/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs @@ -2365,7 +2365,7 @@ public sealed class ArchiWebHandler : IDisposable { return (ESteamApiKeyState.AccessDenied, null); } - INode? htmlNode = response.Content.SelectSingleNode("//div[@id='bodyContents_ex']/p"); + INode? htmlNode = response.Content.SelectSingleNode("//div[@id='bodyContents_ex']//p"); if (htmlNode == null) { Bot.ArchiLogger.LogNullError(htmlNode); @@ -2381,6 +2381,10 @@ public sealed class ArchiWebHandler : IDisposable { return (ESteamApiKeyState.Error, null); } + if (text.Contains("Your account does not meet the requirements", StringComparison.OrdinalIgnoreCase)) { + return (ESteamApiKeyState.RequirementsNotMet, null); + } + if (text.Contains("Registering for a Steam Web API Key", StringComparison.OrdinalIgnoreCase)) { return (ESteamApiKeyState.NotRegisteredYet, null); } @@ -2695,6 +2699,7 @@ public sealed class ArchiWebHandler : IDisposable { return (true, key); case ESteamApiKeyState.NotRegisteredYet: + case ESteamApiKeyState.RequirementsNotMet: // Registration of key requires active ASF 2FA, or user interaction // Show a warning but don't cache this, we expect this to be temporary Bot.ArchiLogger.LogGenericWarning(Strings.BotWarningNoApiKeyRegistered); @@ -2872,6 +2877,7 @@ public sealed class ArchiWebHandler : IDisposable { Timeout, Registered, NotRegisteredYet, - AccessDenied + AccessDenied, + RequirementsNotMet } }