Update version to 1.5.7

- Changed session ID retrieval method in `LoginV2Executor` for avoiding 429 errors
This commit is contained in:
achiez
2025-05-23 16:32:50 +03:00
parent 8ff960189e
commit 2a641e99ae
7 changed files with 124 additions and 9 deletions
+1
View File
@@ -28,6 +28,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "changelog", "changelog", "{
changelog\1.5.4.html = changelog\1.5.4.html
changelog\1.5.5.html = changelog\1.5.5.html
changelog\1.5.6.html = changelog\1.5.6.html
changelog\1.5.7.html = changelog\1.5.7.html
EndProjectSection
EndProject
Global
+1 -1
View File
@@ -10,7 +10,7 @@
<SatelliteResourceLanguages>en;ru;ua</SatelliteResourceLanguages>
<ApplicationIcon>Theme\lock.ico</ApplicationIcon>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
<AssemblyVersion>1.5.6</AssemblyVersion>
<AssemblyVersion>1.5.7</AssemblyVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
+3 -3
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.5.6.0</version>
<url>https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.5.6/NebulaAuth.1.5.6.zip</url>
<changelog>https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.5.6.html</changelog>
<version>1.5.7.0</version>
<url>https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.5.7/NebulaAuth.1.5.7.zip</url>
<changelog>https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.5.7.html</changelog>
<mandatory>false</mandatory>
</item>
@@ -63,9 +63,7 @@ public class LoginV2Executor
var executor = new LoginV2Executor(options);
var client = executor.HttpClient;
var globalData = await SteamWebApi.GetMarketGlobalInfo(client, cancellationToken);
var sessionId = globalData.SessionId;
var sessionId = await SteamWebApi.GetLoginSessionId(client, cancellationToken);
var rsgMsg = new GetPasswordRSAPublicKey_Request
{
AccountName = username
@@ -1,7 +1,13 @@
using SteamLib.Core;
using System.Diagnostics.CodeAnalysis;
using System.Text.RegularExpressions;
using SteamLib.Core;
using SteamLib.Exceptions.General;
using SteamLib.Web.Models.GlobalMarketInfo;
using SteamLib.Web.Scrappers.HTML;
using System.Threading;
using JetBrains.Annotations;
using HtmlAgilityPack;
using SteamLib.Core.Models;
namespace SteamLib.Web;
@@ -26,4 +32,29 @@ public static class SteamWebApi
throw new UnsupportedResponseException(resp, ex);
}
}
[RegexPattern]
[SuppressMessage("ReSharper", "UseRawString")]
[SuppressMessage("ReSharper", "StringLiteralTypo")]
private static readonly string _regexTip =
@"g_sessionID = ""(?<g_sessionID>.*)"";"
+ @"\s*g_steamID = (?<g_steamID>.*);";
private static readonly Regex Regex = new(_regexTip, RegexOptions.Compiled);
private const string XPATH = "//div[@class='responsive_page_content']/script";
public static async Task<string> GetLoginSessionId(HttpClient client, CancellationToken cancellationToken = default)
{
var resp = await client.GetStringAsync("https://steamcommunity.com/login/home", cancellationToken);
var document = new HtmlDocument();
document.LoadHtml(resp);
var scriptNode = document.DocumentNode.SelectSingleNode(XPATH) ?? throw new NullReferenceException("Script Node was null");
var script = scriptNode.InnerText;
var match = Regex.Match(script);
if (!match.Success)
throw new UnsupportedResponseException(script, "Page contains script but regex was unsuccessful");
return match.Groups["g_sessionID"].Value;
}
}
+85
View File
@@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Changelog</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #eeeeee;
color: #333;
line-height: 1.6;
}
.changelog-container {
background-color: #fff;
border-radius: 10px;
padding: 25px;
margin: 25px auto;
max-width: 800px;
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.change {
margin-bottom: 20px;
padding: 0;
border-left: 4px solid #a50ec7;
background-color: #f9f9f9;
}
.version {
font-weight: 600;
font-size: 1.5em;
color: #a50ec7;
margin-left: 10px;
}
.date {
font-style: italic;
color: #888;
margin-bottom: 10px;
margin-left: 15px;
}
.description {
font-size: 1em;
padding: 0 15px;
}
.description ul {
list-style: inside square;
padding: 0;
}
@media only screen and (max-width: 600px) {
.changelog-container {
width: 90%;
margin: 25px auto;
padding: 25px;
}
}
</style>
</head>
<body>
<div class="changelog-container">
<!-- Changelog entry -->
<div class="change">
<div class="version">Version 1.5.7</div>
<div class="date">23.05.2025</div>
<div class="description">
<ul>
<li>
<b>NEWS:</b> Official Telegram group now available! Join us at
<b>
<a href="https://t.me/nebulaauth">t.me/nebulaauth</a>
</b>
</li>
<li><b>FIX:</b>Removed request to /market/ upon login to prevent 429 error on banned IP</li>
</ul>
</div>
</div>
</div>
</body>
</html>