Исправлена документация, код перед импортом, тайпхинты
このコミットが含まれているのは:
コミット
0f736857b9
|
@ -12,4 +12,3 @@
|
|||
yandex_music.artist.brief_info
|
||||
yandex_music.artist.artist_tracks
|
||||
yandex_music.artist.artist_albums
|
||||
yandex_music.artist.pager
|
||||
|
|
|
@ -3,5 +3,4 @@ yandex_music.Pager
|
|||
|
||||
.. autoclass:: yandex_music.Pager
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
|
@ -3,30 +3,32 @@
|
|||
|
||||
.. toctree::
|
||||
|
||||
yandex_music.artist
|
||||
yandex_music.playlist
|
||||
yandex_music.utils
|
||||
yandex_music.genre
|
||||
yandex_music.track
|
||||
yandex_music.account
|
||||
yandex_music.likes
|
||||
yandex_music.album
|
||||
yandex_music.search
|
||||
yandex_music.landing
|
||||
yandex_music.feed
|
||||
yandex_music.rotor
|
||||
yandex_music.supplement
|
||||
|
||||
yandex_music.base
|
||||
yandex_music.client
|
||||
yandex_music.settings
|
||||
yandex_music.permission_alerts
|
||||
yandex_music.experiments
|
||||
yandex_music.track_short
|
||||
yandex_music.promo_code_status
|
||||
yandex_music.invocation_info
|
||||
yandex_music.icon
|
||||
yandex_music.base
|
||||
yandex_music.cover
|
||||
yandex_music.download_info
|
||||
yandex_music.experiments
|
||||
yandex_music.icon
|
||||
yandex_music.invocation_info
|
||||
yandex_music.pager
|
||||
yandex_music.permission_alerts
|
||||
yandex_music.promo_code_status
|
||||
yandex_music.settings
|
||||
yandex_music.track_short
|
||||
yandex_music.tracks_list
|
||||
yandex_music.video
|
||||
|
||||
yandex_music.account
|
||||
yandex_music.album
|
||||
yandex_music.artist
|
||||
yandex_music.feed
|
||||
yandex_music.genre
|
||||
yandex_music.landing
|
||||
yandex_music.likes
|
||||
yandex_music.playlist
|
||||
yandex_music.rotor
|
||||
yandex_music.search
|
||||
yandex_music.shot
|
||||
yandex_music.supplement
|
||||
yandex_music.track
|
||||
yandex_music.utils
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
Пакет yandex_music.shot
|
||||
=======================
|
||||
|
||||
.. toctree::
|
||||
|
||||
yandex_music.shot.shot
|
||||
yandex_music.shot.shot_data
|
||||
yandex_music.shot.shot_event
|
||||
yandex_music.shot.shot_type
|
|
@ -0,0 +1,7 @@
|
|||
yandex_music.Shot
|
||||
=================
|
||||
|
||||
.. autoclass:: yandex_music.Shot
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
|
@ -0,0 +1,7 @@
|
|||
yandex_music.ShotData
|
||||
=====================
|
||||
|
||||
.. autoclass:: yandex_music.ShotData
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
|
@ -0,0 +1,7 @@
|
|||
yandex_music.ShotEvent
|
||||
======================
|
||||
|
||||
.. autoclass:: yandex_music.ShotEvent
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
|
@ -0,0 +1,7 @@
|
|||
yandex_music.ShotType
|
||||
=====================
|
||||
|
||||
.. autoclass:: yandex_music.ShotType
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, PassportPhone
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Account(YandexMusicObject):
|
||||
"""Класс, представляющий основную информацию об аккаунте пользователя.
|
||||
|
@ -92,9 +92,8 @@ class Account(YandexMusicObject):
|
|||
|
||||
Args:
|
||||
filename (:obj:`str`): Путь для сохранения файла с названием и расширением.
|
||||
format_ (:obj:`str`): Формат желаемого изображения (normal, orig, small, big).
|
||||
format_ (:obj:`str`): Формат желаемого изображения (`normal`, `orig`, `small`, `big`).
|
||||
"""
|
||||
|
||||
self.client.request.download(f'https://upics.yandex.net/{self.uid}/{format_}', filename)
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Product
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class AutoRenewable(YandexMusicObject):
|
||||
"""Класс, представляющий автопродление подписки.
|
||||
|
@ -87,7 +87,8 @@ class AutoRenewable(YandexMusicObject):
|
|||
Music.
|
||||
|
||||
Returns:
|
||||
:obj:`list` из :obj:`yandex_music.AutoRenewable`: Список объектов класса :class:`yandex_music.AutoRenewable`.
|
||||
:obj:`list` из :obj:`yandex_music.AutoRenewable`: Список объектов класса
|
||||
:class:`yandex_music.AutoRenewable`.
|
||||
"""
|
||||
if not data:
|
||||
return []
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class PassportPhone(YandexMusicObject):
|
||||
"""Класс, представляющий номер телефона пользователя.
|
||||
|
@ -59,7 +59,8 @@ class PassportPhone(YandexMusicObject):
|
|||
Music.
|
||||
|
||||
Returns:
|
||||
:obj:`list` из :obj:`yandex_music.PassportPhone`: Список объектов класса :class:`yandex_music.PassportPhone`.
|
||||
:obj:`list` из :obj:`yandex_music.PassportPhone`: Список объектов класса
|
||||
:class:`yandex_music.PassportPhone`.
|
||||
"""
|
||||
if not data:
|
||||
return []
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Permissions(YandexMusicObject):
|
||||
"""Класс, представляющий информацию о правах пользователя, их изначальных значениях и даты окончания.
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Plus(YandexMusicObject):
|
||||
"""Класс, представляющий Plus подписку.
|
||||
"""Класс, представляющий `Plus` подписку.
|
||||
|
||||
Attributes:
|
||||
has_plus (:obj:`bool`): Наличие.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Price(YandexMusicObject):
|
||||
"""Класс, представляющий цену.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Price
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Product(YandexMusicObject):
|
||||
"""Класс, представляющий продаваемый продукт.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Account, Permissions, Subscription, Plus
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Status(YandexMusicObject):
|
||||
"""Класс, представляющий подробную информацию об аккаунте пользователя.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, AutoRenewable
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Subscription(YandexMusicObject):
|
||||
"""Класс, представляющий информацию о подписках пользователя.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class UserSettings(YandexMusicObject):
|
||||
"""Класс, представляющий настройки пользователя.
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Artist, Label, TrackPosition, Track
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Album(YandexMusicObject):
|
||||
"""Класс, представляющий альбом.
|
||||
|
||||
Известные типы альбома: `single` - сингл, `compilation` - сборник.
|
||||
Note:
|
||||
Известные типы альбома: `single` - сингл, `compilation` - сборник.
|
||||
|
||||
Известные предупреждения о содержимом: `explicit` - ненормативная лексика.
|
||||
Известные предупреждения о содержимом: `explicit` - ненормативная лексика.
|
||||
|
||||
Известные ошибки: `not-found` - альбом с таким ID не существует.
|
||||
Известные ошибки: `not-found` - альбом с таким ID не существует.
|
||||
|
||||
Attributes:
|
||||
id (:obj:`int`): Идентификатор альбома.
|
||||
|
@ -144,7 +145,6 @@ class Album(YandexMusicObject):
|
|||
|
||||
client.albums_with_tracks(album.id, *args, **kwargs)
|
||||
"""
|
||||
|
||||
return self.client.albums_with_tracks(self.id, *args, **kwargs)
|
||||
|
||||
def download_cover(self, filename: str, size: str = '200x200') -> None:
|
||||
|
@ -154,19 +154,17 @@ class Album(YandexMusicObject):
|
|||
filename (:obj:`str`): Путь для сохранения файла с названием и расширением.
|
||||
size (:obj:`str`, optional): Размер обложки.
|
||||
"""
|
||||
|
||||
self.client.request.download(f'https://{self.cover_uri.replace("%%", size)}', filename)
|
||||
|
||||
def download_og_image(self, filename: str, size: str = '200x200') -> None:
|
||||
"""Загрузка обложки.
|
||||
|
||||
Предпочтительнее использовать self.download_cover().
|
||||
Предпочтительнее использовать `self.download_cover()`.
|
||||
|
||||
Args:
|
||||
filename (:obj:`str`): Путь для сохранения файла с названием и расширением.
|
||||
size (:obj:`str`, optional): Размер обложки.
|
||||
"""
|
||||
|
||||
self.client.request.download(f'https://{self.og_image.replace("%%", size)}', filename)
|
||||
|
||||
def like(self, *args, **kwargs) -> bool:
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Label(YandexMusicObject):
|
||||
"""Класс, представляющий лейбл альбома.
|
||||
|
||||
Attributes:
|
||||
id (:obj:`int`): Идентификатор альбома.
|
||||
name (:obj:`str`): Название альбома.
|
||||
client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex
|
||||
Music.
|
||||
Args:
|
||||
id_ (:obj:`int`): Идентификатор альбома.
|
||||
name (:obj:`str`): Название альбома.
|
||||
client (:obj:`yandex_music.Client`, optional): Объект класса :class:`yandex_music.Client` представляющий
|
||||
клиент Yandex Music.
|
||||
**kwargs: Произвольные ключевые аргументы полученные от API.
|
||||
"""
|
||||
Attributes:
|
||||
id (:obj:`int`): Идентификатор альбома.
|
||||
name (:obj:`str`): Название альбома.
|
||||
client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex
|
||||
Music.
|
||||
Args:
|
||||
id_ (:obj:`int`): Идентификатор альбома.
|
||||
name (:obj:`str`): Название альбома.
|
||||
client (:obj:`yandex_music.Client`, optional): Объект класса :class:`yandex_music.Client` представляющий
|
||||
клиент Yandex Music.
|
||||
**kwargs: Произвольные ключевые аргументы полученные от API.
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
id_: int,
|
||||
name: str,
|
||||
|
@ -36,12 +37,12 @@ class Label(YandexMusicObject):
|
|||
def de_json(cls, data: dict, client: 'Client') -> Optional['Label']:
|
||||
"""Десериализация объекта.
|
||||
|
||||
Args:
|
||||
data (:obj:`dict`): Поля и значения десериализуемого объекта.
|
||||
client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент
|
||||
Yandex Music.
|
||||
Returns:
|
||||
:obj:`yandex_music.Label`: Объект класса :class:`yandex_music.Label`.
|
||||
Args:
|
||||
data (:obj:`dict`): Поля и значения десериализуемого объекта.
|
||||
client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент
|
||||
Yandex Music.
|
||||
Returns:
|
||||
:obj:`yandex_music.Label`: Объект класса :class:`yandex_music.Label`.
|
||||
"""
|
||||
if not data:
|
||||
return None
|
||||
|
@ -54,12 +55,12 @@ class Label(YandexMusicObject):
|
|||
def de_list(cls, data: dict, client: 'Client') -> List['Label']:
|
||||
"""Десериализация списка объектов.
|
||||
|
||||
Args:
|
||||
data (:obj:`list`): Список словарей с полями и значениями десериализуемого объекта.
|
||||
client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент
|
||||
Yandex Music.
|
||||
Returns:
|
||||
:obj:`list` из :obj:`yandex_music.Label`: Список объектов класса :class:`yandex_music.Label`.
|
||||
Args:
|
||||
data (:obj:`list`): Список словарей с полями и значениями десериализуемого объекта.
|
||||
client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент
|
||||
Yandex Music.
|
||||
Returns:
|
||||
:obj:`list` из :obj:`yandex_music.Label`: Список объектов класса :class:`yandex_music.Label`.
|
||||
"""
|
||||
if not data:
|
||||
return []
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class TrackPosition(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Cover, Ratings, Counts, Link, Track, Description, ArtistTracks, ArtistAlbums
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Artist(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Album, Pager
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class ArtistAlbums(YandexMusicObject):
|
||||
"""Класс, представляющий страницу списка альбомов артиста.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Track, Pager
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class ArtistTracks(YandexMusicObject):
|
||||
"""Класс, представляющий страницу списка треков артиста.
|
||||
|
@ -18,8 +18,8 @@ class ArtistTracks(YandexMusicObject):
|
|||
Args:
|
||||
tracks (:obj:`list` из :obj:`yandex_music.Track`): Список треков артиста.
|
||||
pager (:obj:`yandex_music.Pager`): Объект класса :class:`yandex_music.Pager` представляющий пагинатор.
|
||||
client (:obj:`yandex_music.Client`, optional): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex
|
||||
Music.
|
||||
client (:obj:`yandex_music.Client`, optional): Объект класса :class:`yandex_music.Client` представляющий клиент
|
||||
Yandex Music.
|
||||
**kwargs: Произвольные ключевые аргументы полученные от API.
|
||||
"""
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Artist, Track, Album, Cover, PlaylistId, Video, Chart, Vinyl
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class BriefInfo(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Counts(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Description(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Link(YandexMusicObject):
|
||||
"""Класс, представляющий ссылку на официальную страницу исполнителя.
|
||||
|
||||
Известные типы страниц: `official` - официальный сайт и `social` - социальная сеть.
|
||||
Note:
|
||||
Известные типы страниц: `official` - официальный сайт и `social` - социальная сеть.
|
||||
|
||||
Attributes:
|
||||
title (:obj:`str`): Название страницы.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Ratings(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Vinyl(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
@ -38,7 +38,6 @@ class Vinyl(YandexMusicObject):
|
|||
Returns:
|
||||
:obj:`yandex_music.Vinyl`: Объект класса :class:`yandex_music.Vinyl`.
|
||||
"""
|
||||
|
||||
if not data:
|
||||
return None
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ class YandexMusicObject:
|
|||
elif isinstance(val, list):
|
||||
return [parse(it) for it in val]
|
||||
elif isinstance(val, dict):
|
||||
return {k: parse(v) for k, v in val.items()}
|
||||
return {key: parse(value) for key, value in val.items()}
|
||||
else:
|
||||
return val
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ class Client(YandexMusicObject):
|
|||
return Status.de_json(result, self)
|
||||
|
||||
@log
|
||||
def account_settings(self, timeout: Union[int, float] = None, *args, **kwargs) -> Optional[Settings]:
|
||||
def account_settings(self, timeout: Union[int, float] = None, *args, **kwargs) -> Optional[UserSettings]:
|
||||
"""Получение настроек текущего пользователя.
|
||||
|
||||
Args:
|
||||
|
@ -268,7 +268,7 @@ class Client(YandexMusicObject):
|
|||
@log
|
||||
def account_settings_set(self, param: str = None, value: Union[str, int, bool] = None,
|
||||
data: Dict[str, Union[str, int, bool]] = None, timeout: Union[int, float] = None,
|
||||
*args, **kwargs) -> Optional[Settings]:
|
||||
*args, **kwargs) -> Optional[UserSettings]:
|
||||
"""Изменение настроек текущего пользователя.
|
||||
|
||||
Note:
|
||||
|
@ -530,7 +530,7 @@ class Client(YandexMusicObject):
|
|||
|
||||
@log
|
||||
def tracks_similar(self, track_id: Union[str, int], timeout: Union[int, float] = None,
|
||||
*args, **kwargs) -> Optional:
|
||||
*args, **kwargs) -> Optional[SimilarTracks]:
|
||||
"""Получение похожих треков.
|
||||
|
||||
Args:
|
||||
|
@ -713,7 +713,7 @@ class Client(YandexMusicObject):
|
|||
|
||||
@log
|
||||
def users_settings(self, user_id: Union[str, int] = None, timeout: Union[int, float] = None,
|
||||
*args, **kwargs) -> Optional[Settings]:
|
||||
*args, **kwargs) -> Optional[UserSettings]:
|
||||
"""Получение настроек пользователя.
|
||||
|
||||
Note:
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Cover(YandexMusicObject):
|
||||
"""Класс, представляющий обложку.
|
||||
|
@ -12,7 +12,7 @@ class Cover(YandexMusicObject):
|
|||
Attributes:
|
||||
type (:obj:`str`): Тип обложки.
|
||||
uri (:obj:`str`): Ссылка на изображение.
|
||||
items_uri (:obj:`str`): ССписок ссылок на изображения.
|
||||
items_uri (:obj:`str`): Список ссылок на изображения.
|
||||
dir (:obj:`str`): Директория хранения изображения на сервере.
|
||||
version (:obj:`str`): Версия.
|
||||
custom (:obj:`bool`): Является ли обложка пользовательской.
|
||||
|
@ -63,7 +63,7 @@ class Cover(YandexMusicObject):
|
|||
|
||||
Args:
|
||||
filename (:obj:`str`): Путь для сохранения файла с названием и расширением.
|
||||
index (:obj:`int`, optional): Индекс элемента в списке ссылок на обложки если нет self.uri.
|
||||
index (:obj:`int`, optional): Индекс элемента в списке ссылок на обложки если нет `self.uri`.
|
||||
size (:obj:`str`, optional): Размер изображения.
|
||||
"""
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
from xml.dom.minicompat import NodeList
|
||||
|
||||
from hashlib import md5
|
||||
import xml.dom.minidom as minidom
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
from xml.dom.minicompat import NodeList
|
||||
|
||||
|
||||
class DownloadInfo(YandexMusicObject):
|
||||
"""Класс, представляющий информацию о вариантах загрузки трека.
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Experiments(YandexMusicObject):
|
||||
"""Класс представления каких-то свистелок-перделок, флажков, режимов экспериментальных функций.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Album, Track
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class AlbumEvent(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Artist, Track
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class ArtistEvent(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Event, Track, TrackWithAds
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Day(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Track, AlbumEvent, ArtistEvent
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Event(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, GeneratedPlaylist, Day
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Feed(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Playlist
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class GeneratedPlaylist(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Track
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class TrackWithAds(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List, Dict
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Title, Icon, Images
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Genre(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Images(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, Dict
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Title(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Icon(YandexMusicObject):
|
||||
"""Класс, представляющий иконку.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class InvocationInfo(YandexMusicObject):
|
||||
"""Класс, представляющий информацию о запросе.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List, Union
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, BlockEntity, PersonalPlaylistsData, PlayContextsData
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Block(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
from typing import TYPE_CHECKING, Optional, List, Union
|
||||
|
||||
from yandex_music import YandexMusicObject, Promotion, Album, Playlist, MixLink, PlayContext, ChartItem, \
|
||||
GeneratedPlaylist
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject, Promotion, Album, Playlist, MixLink, PlayContext, ChartItem,\
|
||||
GeneratedPlaylist
|
||||
|
||||
|
||||
de_json = {
|
||||
'personal-playlist': GeneratedPlaylist.de_json,
|
||||
'promotion': Promotion.de_json,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, TrackId
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Chart(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Track, Chart
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class ChartItem(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List, Union
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Block
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Landing(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class MixLink(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class PersonalPlaylistsData(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, TrackShortOld
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class PlayContext(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, TrackShortOld
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class PlayContextsData(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Promotion(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class TrackId(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, TrackId
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class TrackShortOld(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Album
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class AlbumsLikes(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Artist
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class ArtistsLikes(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Playlist
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class PlaylistsLikes(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Pager(YandexMusicObject):
|
||||
"""Класс, представляющий пагинатор.
|
||||
|
@ -20,8 +20,8 @@ class Pager(YandexMusicObject):
|
|||
total (:obj:`int`): Всего треков.
|
||||
page (:obj:`int`): Номер страницы.
|
||||
per_page (:obj:`int`): Количество треков на странице.
|
||||
client (:obj:`yandex_music.Client`, optional): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex
|
||||
Music.
|
||||
client (:obj:`yandex_music.Client`, optional): Объект класса :class:`yandex_music.Client` представляющий клиент
|
||||
Yandex Music.
|
||||
**kwargs: Произвольные ключевые аргументы полученные от API.
|
||||
"""
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class PermissionAlerts(YandexMusicObject):
|
||||
"""Класс, представляющий оповещения.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class CaseForms(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, User, CaseForms
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class MadeFor(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class PlayCounter(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, User, Cover, MadeFor, TrackShort, PlaylistAbsence, PlayCounter
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Playlist(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class PlaylistAbsence(YandexMusicObject):
|
||||
"""Класс, представляющий причину отсутствия плейлиста.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class PlaylistId(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class User(YandexMusicObject):
|
||||
"""Класс, представляющий пользователя.
|
||||
|
@ -51,7 +51,7 @@ class User(YandexMusicObject):
|
|||
|
||||
Args:
|
||||
filename (:obj:`str`): Путь для сохранения файла с названием и расширением.
|
||||
format_ (:obj:`str`, optional): Формат желаемого изображения (normal, orig, small, big).
|
||||
format_ (:obj:`str`, optional): Формат желаемого изображения (`normal`, `orig`, `small`, `big`).
|
||||
"""
|
||||
|
||||
self.client.request.download(f'https://upics.yandex.net/{self.uid}/{format_}', filename)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Status
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class PromoCodeStatus(YandexMusicObject):
|
||||
"""Класс, представляющий статус активации промо-кода.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, Union
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class AdParams(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, StationResult
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Dashboard(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Value
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class DiscreteScale(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Value
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Enum(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Id(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
from typing import TYPE_CHECKING, Optional, Union
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject, Enum, DiscreteScale
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
de_json = {
|
||||
'enum': Enum.de_json,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class RotorSettings(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Track
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Sequence(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Id, Icon, Restrictions
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Station(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Station, RotorSettings, AdParams
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class StationResult(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Id, Sequence
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class StationTracksResult(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Value(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, Union
|
||||
|
||||
from yandex_music import YandexMusicObject, Artist, Album, Track, Playlist, Video
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject, Artist, Album, Track, Playlist, Video
|
||||
|
||||
|
||||
de_json_result = {
|
||||
'track': Track.de_json,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Best, SearchResult
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Search(YandexMusicObject):
|
||||
"""Класс, представляющий результаты поиска.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List, Union
|
||||
|
||||
from yandex_music import YandexMusicObject, Artist, Album, Track, Playlist, Video
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject, Artist, Album, Track, Playlist, Video
|
||||
|
||||
|
||||
de_json_result = {
|
||||
'track': Track.de_list,
|
||||
|
@ -18,24 +18,24 @@ de_json_result = {
|
|||
class SearchResult(YandexMusicObject):
|
||||
"""Класс, представляющий результаты поиска.
|
||||
|
||||
Attributes:
|
||||
total (:obj:`int`): Количество результатов.
|
||||
per_page (:obj:`int`): Максимальное количество результатов на странице.
|
||||
order (:obj:`int`): Позиция блока.
|
||||
results (:obj:`list` из :obj:`yandex_music.Track` | :obj:`yandex_music.Artist` | :obj:`yandex_music.Album` \
|
||||
| :obj:`yandex_music.Playlist` | :obj:`yandex_music.Video`): Результаты поиска.
|
||||
client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex
|
||||
Music.
|
||||
Attributes:
|
||||
total (:obj:`int`): Количество результатов.
|
||||
per_page (:obj:`int`): Максимальное количество результатов на странице.
|
||||
order (:obj:`int`): Позиция блока.
|
||||
results (:obj:`list` из :obj:`yandex_music.Track` | :obj:`yandex_music.Artist` | :obj:`yandex_music.Album` \
|
||||
| :obj:`yandex_music.Playlist` | :obj:`yandex_music.Video`): Результаты поиска.
|
||||
client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex
|
||||
Music.
|
||||
|
||||
Args:
|
||||
total (:obj:`int`): Количество результатов.
|
||||
per_page (:obj:`int`): Максимальное количество результатов на странице.
|
||||
order (:obj:`int`): Позиция блока.
|
||||
results (:obj:`list` из :obj:`yandex_music.Track` | :obj:`yandex_music.Artist` | :obj:`yandex_music.Album` \
|
||||
| :obj:`yandex_music.Playlist` | :obj:`yandex_music.Video`): Результаты поиска.
|
||||
client (:obj:`yandex_music.Client`, optional): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex
|
||||
Music.
|
||||
**kwargs: Произвольные ключевые аргументы полученные от API.
|
||||
Args:
|
||||
total (:obj:`int`): Количество результатов.
|
||||
per_page (:obj:`int`): Максимальное количество результатов на странице.
|
||||
order (:obj:`int`): Позиция блока.
|
||||
results (:obj:`list` из :obj:`yandex_music.Track` | :obj:`yandex_music.Artist` | :obj:`yandex_music.Album` \
|
||||
| :obj:`yandex_music.Playlist` | :obj:`yandex_music.Video`): Результаты поиска.
|
||||
client (:obj:`yandex_music.Client`, optional): Объект класса :class:`yandex_music.Client` представляющий клиент
|
||||
Yandex Music.
|
||||
**kwargs: Произвольные ключевые аргументы полученные от API.
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Best
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Suggestions(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Product, Price
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Settings(YandexMusicObject):
|
||||
"""Класс, представляющий предложения по покупке.
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, ShotData
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Shot(YandexMusicObject):
|
||||
"""Класс, представляющий шот от Алисы.
|
||||
|
||||
Известные значения поля `status`: `ready`.
|
||||
Note:
|
||||
Известные значения поля `status`: `ready`.
|
||||
|
||||
Attributes:
|
||||
order (:obj:`int`): Порядковый номер при воспроизведении.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, ShotType
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class ShotData(YandexMusicObject):
|
||||
"""Класс, представляющий основную информацию о шоте.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Shot
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class ShotEvent(YandexMusicObject):
|
||||
"""Класс, представляющий событие-шот перед началом следующего трека.
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class ShotType(YandexMusicObject):
|
||||
"""Класс, представляющий тип шота от Алисы.
|
||||
|
||||
Attributes:
|
||||
id_ (:obj:`str`): Уникальный идентификатор типа.
|
||||
id (:obj:`str`): Уникальный идентификатор типа.
|
||||
title (:obj:`str`): Заголовок шота.
|
||||
client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex
|
||||
Music.
|
||||
|
@ -28,11 +28,11 @@ class ShotType(YandexMusicObject):
|
|||
title: str,
|
||||
client: Optional['Client'] = None,
|
||||
**kwargs):
|
||||
self.id_ = id_
|
||||
self.id = id_
|
||||
self.title = title
|
||||
|
||||
self.client = client
|
||||
self._id_attrs = (self.id_, self.title)
|
||||
self._id_attrs = (self.id, self.title)
|
||||
|
||||
@classmethod
|
||||
def de_json(cls, data: dict, client: 'Client') -> Optional['ShotType']:
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Lyrics(YandexMusicObject):
|
||||
"""Класс, представляющий текст трека.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Lyrics, VideoSupplement
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Supplement(YandexMusicObject):
|
||||
"""Класс, представляющий дополнительную информацию о треке.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class VideoSupplement(YandexMusicObject):
|
||||
"""Класс, представляющий видеоклипы.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Major(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Normalization(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List, Union
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Normalization, Major, Album, Artist, Supplement, DownloadInfo
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class Track(YandexMusicObject):
|
||||
def __init__(self,
|
||||
|
@ -88,7 +88,7 @@ class Track(YandexMusicObject):
|
|||
def download_og_image(self, filename: str, size: str = '200x200') -> None:
|
||||
"""Загрузка обложки.
|
||||
|
||||
Предпочтительнее использовать self.download_cover().
|
||||
Предпочтительнее использовать `self.download_cover()`.
|
||||
|
||||
Args:
|
||||
filename (:obj:`str`): Путь для сохранения файла с названием и расширением.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from typing import TYPE_CHECKING, Optional, List
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from yandex_music import Client, Track
|
||||
|
||||
from yandex_music import YandexMusicObject
|
||||
|
||||
|
||||
class SimilarTracks(YandexMusicObject):
|
||||
"""Класс, представляющий список похожих треков на другой трек.
|
||||
|
|
変更されたファイルが多すぎるため、一部のファイルは表示されません さらに表示
読み込み中…
新しいイシューから参照