YandexMusicResolver
A library aimed at searching, resolving and getting direct links to tracks, playlists or albums in Yandex.Music. Can work without authorization.
Install
| Product | Versions |
|---|---|
| .NET Standard |
README
YandexMusicResolver
A library aimed at searching, resolving and getting direct links to tracks, playlists or albums in Yandex.Music.
Can work without authorization.
Getting started
Add nuget package to your project:
dotnet add package YandexMusicResolverCreate auth service instance (
YandexMusicAuthServicethis is the default implementation):var authService = new YandexMusicAuthService(httpClient);Actually, preferred way is to use
IHttpClientFactoryto pass it to all services. If you useIHttpClientFactorydefault HttpClient name isYandexMusic.Create credentials provider instance (
YandexCredentialsProviderthis is the default implementation):var credentialProvider = new YandexMusicAuthService(authService, "Login", "Pass");Create an instance of
YandexMusicMainResolverand pass config to itvar yandexMusicMainResolver = new YandexMusicMainResolver(credentialProvider, httpClient);After that we can use
YandexMusicMainResolvermethods and other loaders methods.
Example code for getting direct track download url:
var httpClient = new HttpClient();
var authService = new YandexMusicAuthService(httpClient);
var credentialProvider = new YandexMusicAuthService(authService, "Login", "Pass");
var yandexMusicMainResolver = new YandexMusicMainResolver(credentialProvider, httpClient);
var directUrl = await yandexMusicMainResolver.DirectUrlLoader.GetDirectUrl("55561798");
Console.WriteLine(directUrl);
Warn: Yandex will return a link to a 30-seconds track if you do not log in (do not use a config with a valid token).
You can take a look at unit test project for additional examples.
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.