sonrac/yandex-music-api

There is no license information available for the latest version (1.0) of this package.

Yandex Music Api wrapper

1.0 2017-06-03 19:30 UTC

This package is auto-updated.

Last update: 2024-03-15 10:03:06 UTC


README

Install

composer require sonrac/yandex-music-api 

or add to your composer.json to require section

{
  "sonrac/yandex-music-api": "1.0"
}

Usages

  • Create instance
use sonrac\YandexMusic\Yandex;

$api = new Yandex('username', 'password');
  • Create instance with proxy. Proxy getting from gimmeProxy
use sonrac\YandexMusic\Yandex;

$api = new Yandex('username', 'password', true);

Api methods

  • Get account status
$accountStatus = $api->getAccountStatus();
  • Get feed
$feed = $api->getFeed();
  • Get genres
$genres = $api->getGenres();
  • Search
$searchResult = $api->search('text', 0);
  • Get user play lists
// For current user
$playLists = $api->getUserPlayLists();

// For some user with uid 1000
$playLists = $api->getUserPlayLists(1000);

* Get play list

```php
$playlist = $api->getPlayList(100);
  • Get play lists
$playlists = $api->getPlayLists([1003, 1010]);
  • Get play lists
$playlists = $api->getPlayLists([1003, 1010]);
  • Remove play list
$resultRemove = $api->removePlaylist(1003);
  • Rename play list
$resultRename = $api->renamePlaylist(1003, 'new playlist');
  • Add tracks to play list
$resultRename = $api->addTrackToPlaylist(1003, [1,2,3,4]);
  • Remove tracks from play list
$resultRename = $api->removeTracksFromPlaylist(1003, [1,2,3,4]);