stounhandj / yandex-music-api
Installs: 84
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/stounhandj/yandex-music-api
Requires
- ext-curl: *
- ext-simplexml: *
README
Not an official package for working with the Yandex API.
Installation
$ composer require stounhandj/yandex-music-api
Or
{ "require": { "stounhandj/yandex-music-api": "^0.5.2" } }
Example get likes tracks
use StounhandJ\YandexMusicApi\Client; $token = "AQAAAAANDd5rMAG1XnIKIEVVMGV4ibf8kw3FeA1"; $client = new Client($token); foreach ($client->getLikesTracks() as $track){ echo $track->title; }
Example of downloading the first track from the album you like
use StounhandJ\YandexMusicApi\Client; $token = "AQAAAAANDd5rMAG1XnIKIEVVMGV4ibf8kw3FeA1"; $client = new Client($token); $likesAlbum = $client->getLikesAlbums()[0]; $firstTrack = $likesAlbum->getTracks()[0]; $result = $firstTrack->downloadTrack("test.mp3");