Fix Yandex Music provider for lossless streaming support (#3093)
authorMikhail Nevskiy <139659391+trudenboy@users.noreply.github.com>
Thu, 5 Feb 2026 13:25:29 +0000 (16:25 +0300)
committerGitHub <noreply@github.com>
Thu, 5 Feb 2026 13:25:29 +0000 (14:25 +0100)
commit582758e08ab43e50fe8e9e081625c927a24f4abf
tree58f2eedad8ec32ea384efeabb4ba03f2caa3915a
parent5b33a4e5927b4d9157d8c9cb14a2463c5dc1cb31
Fix Yandex Music provider for lossless streaming support (#3093)

* yandex_music: Add lossless streaming via get-file-info API and unit tests

Improve Yandex Music provider with proper lossless (FLAC) streaming support
and comprehensive test coverage.

## Changes

### Lossless Streaming (api_client.py, streaming.py)
- Add `get_track_file_info_lossless()` API method using `/get-file-info`
  endpoint with quality=lossless parameter
- Prefer flac-mp4/aac-mp4 codecs (Yandex API 2025 format)
- Implement retry logic: try transports=encraw first, fallback to
  transports=raw on 401 Unauthorized
- When lossless requested, try get-file-info first (returns FLAC),
  fallback to download-info if unavailable

### Provider improvements (provider.py)
- Minor variable naming fix in get_track()

### Documentation (README.md)
- Add provider README with OAuth token instructions
- Document audio quality settings and lossless troubleshooting

### Tests
- Add unit tests for parsers (artists, albums, tracks, playlists)
- Add unit tests for streaming quality selection logic
- Add snapshot tests for consistent parsing output
- Add fixtures and stubs in conftest.py
- Add integration and e2e test scaffolding

https://claude.ai/code/session_01S4Eth5mUC7hLd3K3JxX7Cy

* Delete tests/providers/yandex_music/test_e2e_server.py

* Update Yandex Music documentation URL

---------

Co-authored-by: Claude <noreply@anthropic.com>
17 files changed:
music_assistant/providers/yandex_music/api_client.py
music_assistant/providers/yandex_music/manifest.json
music_assistant/providers/yandex_music/provider.py
music_assistant/providers/yandex_music/streaming.py
tests/providers/yandex_music/__init__.py [new file with mode: 0644]
tests/providers/yandex_music/__snapshots__/test_parsers.ambr [new file with mode: 0644]
tests/providers/yandex_music/conftest.py [new file with mode: 0644]
tests/providers/yandex_music/fixtures/albums/minimal.json [new file with mode: 0644]
tests/providers/yandex_music/fixtures/artists/minimal.json [new file with mode: 0644]
tests/providers/yandex_music/fixtures/artists/with_cover.json [new file with mode: 0644]
tests/providers/yandex_music/fixtures/playlists/minimal.json [new file with mode: 0644]
tests/providers/yandex_music/fixtures/playlists/other_user.json [new file with mode: 0644]
tests/providers/yandex_music/fixtures/tracks/minimal.json [new file with mode: 0644]
tests/providers/yandex_music/fixtures/tracks/with_artist_and_album.json [new file with mode: 0644]
tests/providers/yandex_music/test_integration.py [new file with mode: 0644]
tests/providers/yandex_music/test_parsers.py [new file with mode: 0644]
tests/providers/yandex_music/test_streaming.py [new file with mode: 0644]