Skip to content

Commit 2a641e9

Browse files
committed
Update version to 1.5.7
- Changed session ID retrieval method in `LoginV2Executor` for avoiding 429 errors
1 parent 8ff9601 commit 2a641e9

File tree

7 files changed

+124
-9
lines changed

7 files changed

+124
-9
lines changed

NebulaAuth.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "changelog", "changelog", "{
2828
changelog\1.5.4.html = changelog\1.5.4.html
2929
changelog\1.5.5.html = changelog\1.5.5.html
3030
changelog\1.5.6.html = changelog\1.5.6.html
31+
changelog\1.5.7.html = changelog\1.5.7.html
3132
EndProjectSection
3233
EndProject
3334
Global

NebulaAuth/NebulaAuth.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<SatelliteResourceLanguages>en;ru;ua</SatelliteResourceLanguages>
1111
<ApplicationIcon>Theme\lock.ico</ApplicationIcon>
1212
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
13-
<AssemblyVersion>1.5.6</AssemblyVersion>
13+
<AssemblyVersion>1.5.7</AssemblyVersion>
1414
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1515
</PropertyGroup>
1616

NebulaAuth/update.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<item>
4-
<version>1.5.6.0</version>
5-
<url>https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.5.6/NebulaAuth.1.5.6.zip</url>
6-
<changelog>https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.5.6.html</changelog>
4+
<version>1.5.7.0</version>
5+
<url>https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.5.7/NebulaAuth.1.5.7.zip</url>
6+
<changelog>https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.5.7.html</changelog>
77
<mandatory>false</mandatory>
88
</item>

SteamLibForked/Account/SessionData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class SessionData : ISessionData
1919

2020
public SteamAuthToken RefreshToken { get; }
2121
public ConcurrentDictionary<SteamDomain, SteamAuthToken> Tokens { get; }
22-
22+
2323
[JsonConstructor]
2424
public SessionData(string sessionId, SteamId steamId, SteamAuthToken refreshToken,
2525
IDictionary<SteamDomain, SteamAuthToken>? tokens)

SteamLibForked/Authentication/LoginV2/LoginV2Executor.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ public static async Task<ISessionData> DoLogin(LoginV2ExecutorOptions options, s
6363
var executor = new LoginV2Executor(options);
6464
var client = executor.HttpClient;
6565

66-
var globalData = await SteamWebApi.GetMarketGlobalInfo(client, cancellationToken);
67-
var sessionId = globalData.SessionId;
68-
66+
var sessionId = await SteamWebApi.GetLoginSessionId(client, cancellationToken);
6967
var rsgMsg = new GetPasswordRSAPublicKey_Request
7068
{
7169
AccountName = username

SteamLibForked/Web/SteamWebApi[folder]/SteamApi_Market.cs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
using SteamLib.Core;
1+
using System.Diagnostics.CodeAnalysis;
2+
using System.Text.RegularExpressions;
3+
using SteamLib.Core;
24
using SteamLib.Exceptions.General;
35
using SteamLib.Web.Models.GlobalMarketInfo;
46
using SteamLib.Web.Scrappers.HTML;
7+
using System.Threading;
8+
using JetBrains.Annotations;
9+
using HtmlAgilityPack;
10+
using SteamLib.Core.Models;
511

612
namespace SteamLib.Web;
713

@@ -26,4 +32,29 @@ public static async Task<GlobalInfoModel> GetMarketGlobalInfo(HttpClient client,
2632
throw new UnsupportedResponseException(resp, ex);
2733
}
2834
}
35+
36+
37+
[RegexPattern]
38+
[SuppressMessage("ReSharper", "UseRawString")]
39+
[SuppressMessage("ReSharper", "StringLiteralTypo")]
40+
private static readonly string _regexTip =
41+
@"g_sessionID = ""(?<g_sessionID>.*)"";"
42+
+ @"\s*g_steamID = (?<g_steamID>.*);";
43+
44+
private static readonly Regex Regex = new(_regexTip, RegexOptions.Compiled);
45+
private const string XPATH = "//div[@class='responsive_page_content']/script";
46+
47+
public static async Task<string> GetLoginSessionId(HttpClient client, CancellationToken cancellationToken = default)
48+
{
49+
var resp = await client.GetStringAsync("https://steamcommunity.com/login/home", cancellationToken);
50+
51+
var document = new HtmlDocument();
52+
document.LoadHtml(resp);
53+
var scriptNode = document.DocumentNode.SelectSingleNode(XPATH) ?? throw new NullReferenceException("Script Node was null");
54+
var script = scriptNode.InnerText;
55+
var match = Regex.Match(script);
56+
if (!match.Success)
57+
throw new UnsupportedResponseException(script, "Page contains script but regex was unsuccessful");
58+
return match.Groups["g_sessionID"].Value;
59+
}
2960
}

changelog/1.5.7.html

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Changelog</title>
7+
<style>
8+
body {
9+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
10+
background-color: #eeeeee;
11+
color: #333;
12+
line-height: 1.6;
13+
}
14+
15+
.changelog-container {
16+
background-color: #fff;
17+
border-radius: 10px;
18+
padding: 25px;
19+
margin: 25px auto;
20+
max-width: 800px;
21+
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
22+
}
23+
24+
.change {
25+
margin-bottom: 20px;
26+
padding: 0;
27+
border-left: 4px solid #a50ec7;
28+
background-color: #f9f9f9;
29+
}
30+
31+
.version {
32+
font-weight: 600;
33+
font-size: 1.5em;
34+
color: #a50ec7;
35+
margin-left: 10px;
36+
}
37+
38+
.date {
39+
font-style: italic;
40+
color: #888;
41+
margin-bottom: 10px;
42+
margin-left: 15px;
43+
}
44+
45+
.description {
46+
font-size: 1em;
47+
padding: 0 15px;
48+
}
49+
50+
.description ul {
51+
list-style: inside square;
52+
padding: 0;
53+
}
54+
55+
@media only screen and (max-width: 600px) {
56+
.changelog-container {
57+
width: 90%;
58+
margin: 25px auto;
59+
padding: 25px;
60+
}
61+
}
62+
</style>
63+
</head>
64+
<body>
65+
66+
<div class="changelog-container">
67+
<!-- Changelog entry -->
68+
<div class="change">
69+
<div class="version">Version 1.5.7</div>
70+
<div class="date">23.05.2025</div>
71+
<div class="description">
72+
<ul>
73+
<li>
74+
<b>NEWS:</b> Official Telegram group now available! Join us at
75+
<b>
76+
<a href="https://t.me/nebulaauth">t.me/nebulaauth</a>
77+
</b>
78+
</li>
79+
<li><b>FIX:</b>Removed request to /market/ upon login to prevent 429 error on banned IP</li>
80+
</ul>
81+
</div>
82+
</div>
83+
</div>
84+
</body>
85+
</html>

0 commit comments

Comments
 (0)