Переделан способ авторизации по qr
All checks were successful
Release / pack-and-publish (release) Successful in 1m5s

This commit is contained in:
FrigaT
2026-04-20 14:31:47 +03:00
parent a7caf829d3
commit 0bbaac5689
15 changed files with 194 additions and 50 deletions

View File

@@ -0,0 +1,23 @@
using System.Net;
using System.Net.Http.Headers;
using YandexMusic.API.Models.Account;
namespace YandexMusic.API.Requests.Account;
internal class YPostQrStatus : YAuthRequestBuilder<YAuthQRStatus?, object>
{
public YPostQrStatus(YandexMusicApi api) : base(api) { }
protected override string Method => WebRequestMethods.Http.Post;
protected override string PathTemplate => "pwl-yandex/api/passport/auth/magic/code/status";
protected override HttpContent? GetContent(object _)
=> new FormUrlEncodedContent(new Dictionary<string, string>
{
["csrf_token"] = Api.Storage.AuthToken.CsfrToken,
["track_id"] = Api.Storage.AuthToken.TrackId,
});
protected override void SetCustomHeaders(HttpRequestHeaders headers)
{
headers.Add("X-Csrf-Token", Api.Storage.HeaderToken.CsfrToken);
headers.Add("Process-Uuid", Api.Storage.HeaderToken.ProcessUuid);
}
}