JustArchiNET / ArchiSteamFarm

C# application with primary purpose of farming Steam cards from multiple accounts simultaneously.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Investigate addlicense breaking changes

JustArchi opened this issue · comments

Checklist

ASF version

Latest stable release

ASF variant

generic (with latest .NET runtime)

Bug description

addlicense command with subs is currently not working due to Steam breaking changes.

Expected behavior

Should work like before.

Actual behavior

Fail/Timeout status code.

Steps to reproduce

addlicense sub/861909

Possible reason/solution

SteamDatabase/BrowserExtension@27da70a

Can you help us with this bug report?

Yes, I can code the solution myself and send a pull request

Full log.txt recorded during reproducing the problem

2023-06-23 10:44:01|dotnet-896320|DEBUG|archi|UrlPostToJsonObject() Request failing: https://store.steampowered.com/checkout/addfreelicense/861909
2023-06-23 10:44:02|dotnet-896320|WARN|archi|UrlPostToJsonObject() Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
   at ArchiSteamFarm.Web.WebBrowser.UrlPostToJsonObject[TResult,TData](Uri request, IReadOnlyCollection`1 headers, TData data, Uri referer, ERequestOptions requestOptions, Byte maxTries, Int32 rateLimitingDelay)
   at ArchiSteamFarm.Web.WebBrowser.UrlPostToJsonObject[TResult,TData](Uri request, IReadOnlyCollection`1 headers, TData data, Uri referer, ERequestOptions requestOptions, Byte maxTries, Int32 rateLimitingDelay)

Global ASF.json config file

No response

BotName.json config of all affected bot instances

No response

Additional info

If somebody has time, feel free to dig into it for me.

It seems like the URL has to be checkout.steampowered.com, the session id has to be the same as on store.steampowered.com, and very importantly, it has to be added as a cookie to the request.

EDIT: (untested)
Maybe something like this would work:
Add

WebBrowser.CookieContainer.Add(new Cookie("sessionid", sessionID, "/", $".{SteamCheckoutURL.Host}"));

to Init()

And change the base uri in AddFreeLicense()

commented

@JustArchi I'm getting the same error despite using the latest version
image

@LORD47 About 9 hours ago a new fix was merged over in #2983 . Next release should fix it once again.