mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 17:10:13 +00:00
committed by
GitHub
parent
5d467aca9a
commit
32196a53cd
@@ -1117,7 +1117,7 @@ public sealed class CardsFarmer : IAsyncDisposable, IDisposable {
|
||||
// Find the number of badge pages
|
||||
Bot.ArchiLogger.LogGenericInfo(Strings.CheckingFirstBadgePage);
|
||||
|
||||
using IDocument? htmlDocument = await Bot.ArchiWebHandler.GetBadgePage(1).ConfigureAwait(false);
|
||||
using IDocument? htmlDocument = await Bot.ArchiWebHandler.GetBadgePage(1, Bot.BotConfig.EnableRiskyCardsDiscovery ? (byte) 2 : WebBrowser.MaxTries).ConfigureAwait(false);
|
||||
|
||||
if (htmlDocument == null) {
|
||||
Bot.ArchiLogger.LogGenericWarning(Strings.WarningCouldNotCheckBadges);
|
||||
|
||||
@@ -1848,14 +1848,18 @@ public sealed class ArchiWebHandler : IDisposable {
|
||||
return result;
|
||||
}
|
||||
|
||||
internal async Task<IDocument?> GetBadgePage(byte page) {
|
||||
internal async Task<IDocument?> GetBadgePage(byte page, byte maxTries = WebBrowser.MaxTries) {
|
||||
if (page == 0) {
|
||||
throw new ArgumentOutOfRangeException(nameof(page));
|
||||
}
|
||||
|
||||
if (maxTries == 0) {
|
||||
throw new ArgumentOutOfRangeException(nameof(maxTries));
|
||||
}
|
||||
|
||||
Uri request = new(SteamCommunityURL, $"/my/badges?l=english&p={page}");
|
||||
|
||||
HtmlDocumentResponse? response = await UrlGetToHtmlDocumentWithSession(request, checkSessionPreemptively: false).ConfigureAwait(false);
|
||||
HtmlDocumentResponse? response = await UrlGetToHtmlDocumentWithSession(request, checkSessionPreemptively: false, maxTries: maxTries).ConfigureAwait(false);
|
||||
|
||||
return response?.Content;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user