mirror of
https://github.com/Horizontal42/Sort_YM.git
synced 2026-11-10 15:42:02 +03:00
CLI на yandex-music (device-flow auth, fetch/report/apply), жанр через реальное дерево client.genres(), язык гибридом (track_supplement + алфавит).
18 lines
378 B
Python
18 lines
378 B
Python
from __future__ import annotations
|
|
|
|
from typing import Iterator, List, TypeVar
|
|
|
|
from yandex_music import Client
|
|
|
|
T = TypeVar("T")
|
|
|
|
|
|
def make_client(token: str) -> Client:
|
|
client = Client(token=token)
|
|
client.init()
|
|
return client
|
|
|
|
|
|
def chunked(items: List[T], size: int) -> Iterator[List[T]]:
|
|
for i in range(0, len(items), size):
|
|
yield items[i : i + size]
|