Полностью переписанное api
All checks were successful
Release / pack-and-publish (release) Successful in 36s
All checks were successful
Release / pack-and-publish (release) Successful in 36s
This commit is contained in:
@@ -1,25 +1,19 @@
|
||||
using System.Net;
|
||||
|
||||
using YandexMusic.API.Common;
|
||||
using System.Net.Http.Headers;
|
||||
using YandexMusic.API.Models.Account;
|
||||
using YandexMusic.API.Requests.Common;
|
||||
using YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
[YPassportRequest(WebRequestMethods.Http.Post, "registration-validations/auth/password/submit")]
|
||||
internal class YGetAuthQRBuilder : YRequestBuilder<YAuthQR, string>
|
||||
public class YGetAuthQRBuilder : YAuthRequestBuilder<YAuthQR?, object>
|
||||
{
|
||||
public YGetAuthQRBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
public YGetAuthQRBuilder(YandexMusicApi api) : base(api) { }
|
||||
protected override string Method => WebRequestMethods.Http.Post;
|
||||
protected override string PathTemplate => "pwl-yandex/api/passport/auth/password/submit";
|
||||
protected override HttpContent? GetContent(object _)
|
||||
=> new FormUrlEncodedContent(new Dictionary<string, string> { { "retpath", "" } });
|
||||
protected override void SetCustomHeaders(HttpRequestHeaders headers)
|
||||
{
|
||||
}
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "retpath", "https://passport.yandex.ru/profile" },
|
||||
{ "with_code", "1" },
|
||||
});
|
||||
headers.Add("X-Csrf-Token", Api.Storage.AuthToken.CsfrToken);
|
||||
headers.Add("Process-Uuid", Api.Storage.AuthToken.ProcessUuid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user