From ca740f2294315bc5baa0cd9c892ef81fbb3f952b Mon Sep 17 00:00:00 2001 From: SKProCH Date: Fri, 15 Jan 2021 17:15:22 +0300 Subject: [PATCH] Add README --- README.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e859ba7 --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ + +
+Project icon + +

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 + +
    + +
  1. + +Add [nuget package](https://www.nuget.org/packages/YandexMusicResolver/) to your project: + +``` +dotnet add package YandexMusicResolver +``` +or +``` +Install-Package YandexMusicResolver -Version 2.0.0 +``` +
  2. + +
  3. + +Create configuration instance (`FileYandexConfig` this is the default implementation to save the config to a file) : + +```c# +var config = new FileYandexConfig("path to store config"); +``` +or use empty config (if you don't want save anything): +```c# +var config = new EmptyYandexConfig(); +``` +After that call `Load` to load config: +```c# +config.Load(); +``` +
  4. + +
  5. + +Create an instance of `YandexMusicMainResolver` and pass config to it +```c# +var yandexMusicMainResolver = new YandexMusicMainResolver(config); +``` +After that we can use `YandexMusicMainResolver` methods and other loaders methods. +
  6. + +
+ +Example code for getting direct track download url: +```c# +var fileYandexConfig = new FileYandexConfig("yandex.config"); +fileYandexConfig.Load(); +var yandexMusicMainResolver = new YandexMusicMainResolver(fileYandexConfig); +var directUrl = await yandexMusicMainResolver.DirectUrlLoader.GetDirectUrl("55561798", "mp3"); +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). + +Methods to assist with authorization can be found in `YandexMusicAuth`. + +For additional examples you can take a look at unit test project. \ No newline at end of file