Обнновлено до .net10
This commit is contained in:
@@ -5,23 +5,22 @@ 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/multi_step/commit_password")]
|
||||
internal class YGetAuthAppPasswordBuilder : YRequestBuilder<YAuthBase, string>
|
||||
{
|
||||
public YGetAuthAppPasswordBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "track_id", storage.AuthToken.TrackId },
|
||||
{ "password", tuple },
|
||||
{ "retpath", "https://passport.yandex.ru/am/finish?status=ok&from=Login" }
|
||||
});
|
||||
}
|
||||
[YPassportRequest(WebRequestMethods.Http.Post, "registration-validations/auth/multi_step/commit_password")]
|
||||
internal class YGetAuthAppPasswordBuilder : YRequestBuilder<YAuthBase, string>
|
||||
{
|
||||
public YGetAuthAppPasswordBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "track_id", storage.AuthToken.TrackId },
|
||||
{ "password", tuple },
|
||||
{ "retpath", "https://passport.yandex.ru/am/finish?status=ok&from=Login" }
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -5,26 +5,25 @@ using YandexMusic.API.Common;
|
||||
using YandexMusic.API.Requests.Common;
|
||||
using YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
namespace YandexMusic.API.Requests.Account
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
[YPassportRequest(WebRequestMethods.Http.Post, "registration-validations/textcaptcha")]
|
||||
internal class YGetAuthCaptchaBuilder : YRequestBuilder<Models.Account.YAuthCaptcha, string>
|
||||
{
|
||||
[YPassportRequest(WebRequestMethods.Http.Post, "registration-validations/textcaptcha")]
|
||||
internal class YGetAuthCaptchaBuilder : YRequestBuilder<Models.Account.YAuthCaptcha, string>
|
||||
public YGetAuthCaptchaBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
public YGetAuthCaptchaBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "track_id", storage.AuthToken.TrackId },
|
||||
});
|
||||
}
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "track_id", storage.AuthToken.TrackId },
|
||||
});
|
||||
}
|
||||
|
||||
protected override void SetCustomHeaders(HttpRequestHeaders headers)
|
||||
{
|
||||
headers.Add("X-Requested-With", "XMLHttpRequest");
|
||||
}
|
||||
protected override void SetCustomHeaders(HttpRequestHeaders headers)
|
||||
{
|
||||
headers.Add("X-Requested-With", "XMLHttpRequest");
|
||||
}
|
||||
}
|
||||
@@ -6,32 +6,31 @@ using YandexMusic.API.Models.Account;
|
||||
using YandexMusic.API.Requests.Common;
|
||||
using YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
namespace YandexMusic.API.Requests.Account
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
[YMobileProxyRequest(WebRequestMethods.Http.Post, "1/bundle/oauth/token_by_sessionid")]
|
||||
internal class YGetAuthCookiesBuilder : YRequestBuilder<YAccessToken, string>
|
||||
{
|
||||
[YMobileProxyRequest(WebRequestMethods.Http.Post, "1/bundle/oauth/token_by_sessionid")]
|
||||
internal class YGetAuthCookiesBuilder : YRequestBuilder<YAccessToken, string>
|
||||
public YGetAuthCookiesBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
public YGetAuthCookiesBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
protected override void SetCustomHeaders(HttpRequestHeaders headers)
|
||||
{
|
||||
CookieCollection cookieCollection = new() {
|
||||
storage.Context.Cookies.GetCookies(new Uri("https://yandex.ru/")),
|
||||
storage.Context.Cookies.GetCookies(new Uri("https://passport.yandex.ru/"))
|
||||
};
|
||||
protected override void SetCustomHeaders(HttpRequestHeaders headers)
|
||||
{
|
||||
CookieCollection cookieCollection = new() {
|
||||
storage.Context.Cookies.GetCookies(new Uri("https://yandex.ru/")),
|
||||
storage.Context.Cookies.GetCookies(new Uri("https://passport.yandex.ru/"))
|
||||
};
|
||||
|
||||
headers.Add("Ya-Client-Cookie", string.Join(";", cookieCollection.Select(c => $"{c.Name}={c.Value}")));
|
||||
headers.Add("Ya-Client-Host", "passport.yandex.ru");
|
||||
}
|
||||
headers.Add("Ya-Client-Cookie", string.Join(";", cookieCollection.Select(c => $"{c.Name}={c.Value}")));
|
||||
headers.Add("Ya-Client-Host", "passport.yandex.ru");
|
||||
}
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "client_id", YConstants.XClientId },
|
||||
{ "client_secret", YConstants.XClientSecret }
|
||||
});
|
||||
}
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "client_id", YConstants.XClientId },
|
||||
{ "client_secret", YConstants.XClientSecret }
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -6,13 +6,12 @@ using YandexMusic.API.Models.Common;
|
||||
using YandexMusic.API.Requests.Common;
|
||||
using YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
namespace YandexMusic.API.Requests.Account
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
[YApiRequest(WebRequestMethods.Http.Get, "account/status")]
|
||||
public class YGetAuthInfoBuilder : YRequestBuilder<YResponse<YAccountResult>, object>
|
||||
{
|
||||
[YApiRequest(WebRequestMethods.Http.Get, "account/status")]
|
||||
public class YGetAuthInfoBuilder : YRequestBuilder<YResponse<YAccountResult>, object>
|
||||
public YGetAuthInfoBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
public YGetAuthInfoBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,27 +4,26 @@ using YandexMusic.API.Common;
|
||||
using YandexMusic.API.Requests.Common;
|
||||
using YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
namespace YandexMusic.API.Requests.Account
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
[YPassportRequest(WebRequestMethods.Http.Post, "registration-validations/auth/send_magic_letter")]
|
||||
internal class YGetAuthLetterBuilder : YRequestBuilder<Models.Account.YAuthLetter, string>
|
||||
{
|
||||
[YPassportRequest(WebRequestMethods.Http.Post, "registration-validations/auth/send_magic_letter")]
|
||||
internal class YGetAuthLetterBuilder : YRequestBuilder<Models.Account.YAuthLetter, string>
|
||||
public YGetAuthLetterBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
public YGetAuthLetterBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
}
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
if (storage.AuthToken == null)
|
||||
{
|
||||
throw new Exception("Не найдена сессия входа.");
|
||||
}
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string>
|
||||
{
|
||||
if (storage.AuthToken == null)
|
||||
{
|
||||
throw new Exception("Не найдена сессия входа.");
|
||||
}
|
||||
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string>
|
||||
{
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "track_id", storage.AuthToken.TrackId },
|
||||
});
|
||||
}
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "track_id", storage.AuthToken.TrackId },
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -6,27 +6,26 @@ using YandexMusic.API.Models.Account;
|
||||
using YandexMusic.API.Requests.Common;
|
||||
using YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
namespace YandexMusic.API.Requests.Account
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
[YPassportRequest(WebRequestMethods.Http.Post, "registration-validations/checkHuman")]
|
||||
internal class YGetAuthLoginCaptchaBuilder : YRequestBuilder<YAuthBase, string>
|
||||
{
|
||||
[YPassportRequest(WebRequestMethods.Http.Post, "registration-validations/checkHuman")]
|
||||
internal class YGetAuthLoginCaptchaBuilder : YRequestBuilder<YAuthBase, string>
|
||||
public YGetAuthLoginCaptchaBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
public YGetAuthLoginCaptchaBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "track_id", storage.AuthToken.TrackId },
|
||||
{ "answer", tuple }
|
||||
});
|
||||
}
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "track_id", storage.AuthToken.TrackId },
|
||||
{ "answer", tuple }
|
||||
});
|
||||
}
|
||||
|
||||
protected override void SetCustomHeaders(HttpRequestHeaders headers)
|
||||
{
|
||||
headers.Add("X-Requested-With", "XMLHttpRequest");
|
||||
}
|
||||
protected override void SetCustomHeaders(HttpRequestHeaders headers)
|
||||
{
|
||||
headers.Add("X-Requested-With", "XMLHttpRequest");
|
||||
}
|
||||
}
|
||||
@@ -5,21 +5,20 @@ 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, "auth/letter/status/")]
|
||||
internal class YGetAuthLoginLetterBuilder : YRequestBuilder<YAuthLetterStatus, string>
|
||||
{
|
||||
public YGetAuthLoginLetterBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "track_id", storage.AuthToken.TrackId },
|
||||
});
|
||||
}
|
||||
[YPassportRequest(WebRequestMethods.Http.Post, "auth/letter/status/")]
|
||||
internal class YGetAuthLoginLetterBuilder : YRequestBuilder<YAuthLetterStatus, string>
|
||||
{
|
||||
public YGetAuthLoginLetterBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "track_id", storage.AuthToken.TrackId },
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -5,21 +5,20 @@ 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, "auth/new/magic/status/")]
|
||||
internal class YGetAuthLoginQRBuilder : YRequestBuilder<YAuthQRStatus, string>
|
||||
{
|
||||
public YGetAuthLoginQRBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "track_id", storage.AuthToken.TrackId }
|
||||
});
|
||||
}
|
||||
[YPassportRequest(WebRequestMethods.Http.Post, "auth/new/magic/status/")]
|
||||
internal class YGetAuthLoginQRBuilder : YRequestBuilder<YAuthQRStatus, string>
|
||||
{
|
||||
public YGetAuthLoginQRBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", storage.AuthToken.CsfrToken },
|
||||
{ "track_id", storage.AuthToken.TrackId }
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -5,21 +5,20 @@ 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/multi_step/start")]
|
||||
internal class YGetAuthLoginUserBuilder : YRequestBuilder<YAuthTypes, (string token, string login)>
|
||||
{
|
||||
public YGetAuthLoginUserBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
protected override HttpContent GetContent((string token, string login) tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", tuple.token },
|
||||
{ "login", tuple.login }
|
||||
});
|
||||
}
|
||||
[YPassportRequest(WebRequestMethods.Http.Post, "registration-validations/auth/multi_step/start")]
|
||||
internal class YGetAuthLoginUserBuilder : YRequestBuilder<YAuthTypes, (string token, string login)>
|
||||
{
|
||||
public YGetAuthLoginUserBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
|
||||
protected override HttpContent GetContent((string token, string login) tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string> {
|
||||
{ "csrf_token", tuple.token },
|
||||
{ "login", tuple.login }
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -5,20 +5,19 @@ using YandexMusic.API.Common;
|
||||
using YandexMusic.API.Requests.Common;
|
||||
using YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
namespace YandexMusic.API.Requests.Account
|
||||
{
|
||||
[YPassportRequest(WebRequestMethods.Http.Get, "am")]
|
||||
internal class YGetAuthMethodsBuilder : YRequestBuilder<HttpResponseMessage, string>
|
||||
{
|
||||
public YGetAuthMethodsBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
protected override NameValueCollection GetQueryParams(string tuple)
|
||||
{
|
||||
return new NameValueCollection {
|
||||
{ "app_platform", "android" }
|
||||
};
|
||||
}
|
||||
[YPassportRequest(WebRequestMethods.Http.Get, "am")]
|
||||
internal class YGetAuthMethodsBuilder : YRequestBuilder<HttpResponseMessage, string>
|
||||
{
|
||||
public YGetAuthMethodsBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
|
||||
protected override NameValueCollection GetQueryParams(string tuple)
|
||||
{
|
||||
return new NameValueCollection {
|
||||
{ "app_platform", "android" }
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -5,22 +5,21 @@ 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 YGetAuthQRBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
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" },
|
||||
});
|
||||
}
|
||||
[YPassportRequest(WebRequestMethods.Http.Post, "registration-validations/auth/password/submit")]
|
||||
internal class YGetAuthQRBuilder : YRequestBuilder<YAuthQR, string>
|
||||
{
|
||||
public YGetAuthQRBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
|
||||
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" },
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,12 @@ using YandexMusic.API.Models.Account;
|
||||
using YandexMusic.API.Requests.Common;
|
||||
using YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
namespace YandexMusic.API.Requests.Account
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
[YLoginRequest(WebRequestMethods.Http.Get, "info")]
|
||||
public class YGetLoginInfoBuilder : YRequestBuilder<YLoginInfo, object>
|
||||
{
|
||||
[YLoginRequest(WebRequestMethods.Http.Get, "info")]
|
||||
public class YGetLoginInfoBuilder : YRequestBuilder<YLoginInfo, object>
|
||||
public YGetLoginInfoBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
public YGetLoginInfoBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,31 +6,30 @@ using YandexMusic.API.Models.Account;
|
||||
using YandexMusic.API.Requests.Common;
|
||||
using YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
namespace YandexMusic.API.Requests.Account
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
[YOAuthMobile(WebRequestMethods.Http.Post, "/1/token")]
|
||||
internal class YGetMusicTokenBuilder : YRequestBuilder<YAccessToken, string>
|
||||
{
|
||||
[YOAuthMobile(WebRequestMethods.Http.Post, "/1/token")]
|
||||
internal class YGetMusicTokenBuilder : YRequestBuilder<YAccessToken, string>
|
||||
public YGetMusicTokenBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
public YGetMusicTokenBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
protected override HttpContent GetContent(string tuple)
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string>
|
||||
{
|
||||
return new FormUrlEncodedContent(new Dictionary<string, string>
|
||||
{
|
||||
{ "client_id", YConstants.ClientId },
|
||||
{ "client_secret", YConstants.ClientSecret },
|
||||
{ "grant_type", "x-token" },
|
||||
{ "access_token", storage.AccessToken.AccessToken }
|
||||
});
|
||||
}
|
||||
{ "client_id", YConstants.ClientId },
|
||||
{ "client_secret", YConstants.ClientSecret },
|
||||
{ "grant_type", "x-token" },
|
||||
{ "access_token", storage.AccessToken.AccessToken }
|
||||
});
|
||||
}
|
||||
|
||||
protected override void SetCustomHeaders(HttpRequestHeaders headers)
|
||||
{
|
||||
headers.Remove("Authorization");
|
||||
protected override void SetCustomHeaders(HttpRequestHeaders headers)
|
||||
{
|
||||
headers.Remove("Authorization");
|
||||
|
||||
base.SetCustomHeaders(headers);
|
||||
}
|
||||
base.SetCustomHeaders(headers);
|
||||
}
|
||||
}
|
||||
@@ -7,25 +7,24 @@ using YandexMusic.API.Models.Account;
|
||||
using YandexMusic.API.Requests.Common;
|
||||
using YandexMusic.API.Requests.Common.Attributes;
|
||||
|
||||
namespace YandexMusic.API.Requests.Account
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
[YMobileProxyRequest(WebRequestMethods.Http.Get, "/1/bundle/account/short_info/")]
|
||||
internal class YGetShortAccountInifoBuilder : YRequestBuilder<YShortAccountInfo, object>
|
||||
{
|
||||
[YMobileProxyRequest(WebRequestMethods.Http.Get, "/1/bundle/account/short_info/")]
|
||||
internal class YGetShortAccountInifoBuilder : YRequestBuilder<YShortAccountInfo, object>
|
||||
public YGetShortAccountInifoBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
public YGetShortAccountInifoBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
protected override NameValueCollection GetQueryParams(object tuple)
|
||||
{
|
||||
return new NameValueCollection {
|
||||
{ "avatar_size", "islands-300" }
|
||||
};
|
||||
}
|
||||
protected override NameValueCollection GetQueryParams(object tuple)
|
||||
{
|
||||
return new NameValueCollection {
|
||||
{ "avatar_size", "islands-300" }
|
||||
};
|
||||
}
|
||||
|
||||
protected override void SetCustomHeaders(HttpRequestHeaders headers)
|
||||
{
|
||||
headers.Add("Ya-Consumer-Authorization", $"OAuth {storage.AccessToken.AccessToken}");
|
||||
}
|
||||
protected override void SetCustomHeaders(HttpRequestHeaders headers)
|
||||
{
|
||||
headers.Add("Ya-Consumer-Authorization", $"OAuth {storage.AccessToken.AccessToken}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user