Files
YandexMusic/YandexMusic.API/Requests/Ugc/YUgcUploadBuilder.cs
FrigaT add7f08215
All checks were successful
Release / pack-and-publish (release) Successful in 32s
Добавлен вывод AuthStorage. Спрятаны внутренние api запросы
2026-04-19 17:41:30 +03:00

21 lines
1006 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Net;
using YandexMusic.API.Models.Common;
using YandexMusic.API.Requests.Common;
namespace YandexMusic.API.Requests.Ugc;
/// <summary>Загрузка трека специальный запрос на произвольный URL.</summary>
internal class YUgcUploadBuilder : YJsonRequestBuilder<YResponse<string>?, (string postTargetLink, byte[] fileBytes)>
{
public YUgcUploadBuilder(YandexMusicApi api) : base(api) { }
protected override string BaseUrl => "";
protected override string Method => WebRequestMethods.Http.Post;
protected override string PathTemplate => "{postTargetLink}";
protected override Dictionary<string, string> GetSubstitutions((string postTargetLink, byte[] fileBytes) tuple)
=> new() { { "postTargetLink", tuple.postTargetLink } };
protected override HttpContent? GetContent((string postTargetLink, byte[] fileBytes) tuple)
=> new MultipartFormDataContent { { new ByteArrayContent(tuple.fileBytes), "file" } };
}