Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Playlist.GetTrack(string uid, string kind, string page, string pageSize)

KirMozor edited this page May 7, 2022 · 1 revision

Returns you tracks from a playlist, you need to send uid and kind

Example:

using System;
using YandexMusicApi;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(Playlist.GetTrack("457553308", "792433")); //Uid and Kind: Twenty One Pilots
        }
    }
}

Output:

{
  "invocationInfo": {
    "hostname": "music-stable-back-sas-53.sas.yp-c.yandex.net",
    "req-id": "w[596g-k8h4-978-480h4681f36-=134678j1958y0f8l9362",
    "exec-duration-millis": "42"
  },
  "result": {
    "owner": {
      "uid": 457553308,
      "login": "yamusic-bestsongs",
      "name": "Яндекс Музыка",
      "sex": "unknown",
      "verified": true
    },
    "playlistUuid": "e968c965-bdc0-cfda-b378-a29e03228246",
    "available": true,
    "uid": 457553308,
    "kind": 792433,
    "title": "Лучшее: twenty one pilots",
    "description": "twenty one pilots: самые популярные треки на Яндекс.Музыке",
    "descriptionFormatted": "twenty one pilots: самые популярные треки на Яндекс.Музыке",
    "revision": 0,
    "snapshot": 1,
    "trackCount": 20,
    "visibility": "public",
    "collective": false,
    "created": "2018-09-10T16:54:57+06:00",
    "modified": "2022-04-01T06:12:27+06:00",
    "isBanner": false,
    "isPremiere": false,
    "idForFrom": "artist_top",
    "durationMs": 4417170,
    "cover": {
      "type": "pic",
      "dir": "/get-music-user-playlist/34120/quw4g3m5jpayzI/",
      "version": "1624007812403",
      "uri": "avatars.yandex.net/get-music-user-playlist/34120/quw4g3m5jpayzI/%%?1624007812403",
      "custom": true
    },
    "ogImage": "avatars.yandex.net/get-music-user-playlist/34120/quw4g3m5jpayzI/%%?1624007812403",
    "tracks": [
      {
        "id": 23559960,
        "track": {
          "id": "23559960",
          "realId": "23559960",
          "title": "Stressed Out",
          "trackSource": "OWN",
          "major": {
            "id": 4,
            "name": "WARNER"
          },
          "available": true,
          "availableForPremiumUsers": true,
          "availableFullWithoutPermission": false,
          "durationMs": 202330,
          "storageDir": "",
          "fileSize": 0,
          "r128": {
            "i": -7.92,
            "tp": 2.27
          },
          "previewDurationMs": 30000,
          "artists": [
            {
              "id": 792433,
              "name": "twenty one pilots",
              "various": false,
              "composer": false,
              "cover": {
                "type": "from-artist-photos",
                "prefix": "4109b721.p.792433/",
                "uri": "avatars.yandex.net/get-music-content/4489759/4109b721.p.792433/%%"
              },
              "genres": []
            }
          ],
          "albums": [
            {
              "id": 2747498,
              "title": "Blurryface",
              "metaType": "music",
              "year": 2015,
              "releaseDate": "2015-05-15T03:00:00+06:00",
              "coverUri": "avatars.yandex.net/get-music-content/32236/0719cba3.a.2747498-1/%%",
              "ogImage": "avatars.yandex.net/get-music-content/32236/0719cba3.a.2747498-1/%%",
              "genre": "indie",
              "buy": [],
              "trackCount": 14,
              "likesCount": 743,
              "recent": false,
              "veryImportant": false,
              "artists": [
                {
                  "id": 792433,
                  "name": "twenty one pilots",
                  "various": false,
                  "composer": false,
                  "cover": {
                    "type": "from-artist-photos",
                    "prefix": "4109b721.p.792433/",
                    "uri": "avatars.yandex.net/get-music-content/4489759/4109b721.p.792433/%%"
                  },
                  "genres": []
                }
              ],
              "labels": [
                {
                  "id": 271419,
                  "name": "Fueled By Ramen"
                }
              ],
              "available": true,
              "availableForPremiumUsers": true,
              "availableForMobile": true,
              "availablePartially": false,
              "bests": [],
              "trackPosition": {
                "volume": 1,
                "index": 2
              }
            }
          ],
          "coverUri": "avatars.yandex.net/get-music-content/32236/0719cba3.a.2747498-1/%%",
          "ogImage": "avatars.yandex.net/get-music-content/32236/0719cba3.a.2747498-1/%%",
          "lyricsAvailable": true,
          "lyricsInfo": {
            "hasAvailableSyncLyrics": true,
            "hasAvailableTextLyrics": true
          },
          "type": "music",
          "rememberPosition": false,
          "backgroundVideoUri": "https://strm.yandex.ru/vh-music-videoshots-converted/vod-content/1430817352333660610/mp4/mp4/360x640p.mp4",
          "trackSharingFlag": "COVER_ONLY",
          "playerId": "vsqUtkNgc5Rw"
        },
        "timestamp": "2022-04-01T06:12:27+06:00",
        "originalIndex": 0,
        "recent": false
      },
A lot of text
Clone this wiki locally