diff --git a/yandex_music/__init__.py b/yandex_music/__init__.py index 8a16d51..ea716eb 100644 --- a/yandex_music/__init__.py +++ b/yandex_music/__init__.py @@ -97,7 +97,6 @@ from .supplement.video_supplement import VideoSupplement from .pager import Pager from .cover import Cover -from .experiments import Experiments from .invocation_info import InvocationInfo from .track_short import TrackShort from .icon import Icon diff --git a/yandex_music/album/album.py b/yandex_music/album/album.py index af03301..2dcab04 100644 --- a/yandex_music/album/album.py +++ b/yandex_music/album/album.py @@ -3,7 +3,7 @@ from yandex_music import YandexMusicObject class Album(YandexMusicObject): def __init__(self, - id, + id_, title, track_count, artists, @@ -25,12 +25,12 @@ class Album(YandexMusicObject): volumes=None, year=None, release_date=None, - type=None, + type_=None, track_position=None, regions=None, client=None, **kwargs): - self.id = id + self.id = id_ self.title = title self.track_count = track_count self.artists = artists @@ -51,7 +51,7 @@ class Album(YandexMusicObject): self.very_important = very_important self.available_for_mobile = available_for_mobile self.available_partially = available_partially - self.type = type + self.type = type_ self.track_position = track_position self.regions = regions self.original_release_year = original_release_year diff --git a/yandex_music/album/label.py b/yandex_music/album/label.py index 861370b..9b19a28 100644 --- a/yandex_music/album/label.py +++ b/yandex_music/album/label.py @@ -3,25 +3,25 @@ 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`): Идентификатор альбома. + id_ (:obj:`int`): Идентификатор альбома. name (:obj:`str`): Название альбома. client (:obj:`yandex_music.Client`, optional): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex Music. **kwargs: Произвольные ключевые аргументы полученные от API. """ def __init__(self, - id, + id_, name, client=None, **kwargs): - self.id = id + self.id = id_ self.name = name self.client = client @@ -33,8 +33,8 @@ class Label(YandexMusicObject): Args: data (:obj:`dict`): Поля и значения десериализуемого объекта. - client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент Yandex - Music. + client (:obj:`yandex_music.Client`): Объект класса :class:`yandex_music.Client` представляющий клиент + Yandex Music. Returns: :obj:`yandex_music.Label`: Объект класса :class:`yandex_music.Label`. """ diff --git a/yandex_music/artist/artist.py b/yandex_music/artist/artist.py index b766c16..6405269 100644 --- a/yandex_music/artist/artist.py +++ b/yandex_music/artist/artist.py @@ -3,7 +3,7 @@ from yandex_music import YandexMusicObject class Artist(YandexMusicObject): def __init__(self, - id, + id_, name, cover, various=None, @@ -30,7 +30,7 @@ class Artist(YandexMusicObject): end_date=None, client=None, **kwargs): - self.id = id + self.id = id_ self.name = name self.cover = cover diff --git a/yandex_music/artist/artist_tracks.py b/yandex_music/artist/artist_tracks.py index 0c69949..40ba151 100644 --- a/yandex_music/artist/artist_tracks.py +++ b/yandex_music/artist/artist_tracks.py @@ -17,7 +17,7 @@ class ArtistTracks(YandexMusicObject): Music. **kwargs: Произвольные ключевые аргументы полученные от API. """ - + def __init__(self, tracks, pager, diff --git a/yandex_music/artist/link.py b/yandex_music/artist/link.py index 1bf4dce..2e42a38 100644 --- a/yandex_music/artist/link.py +++ b/yandex_music/artist/link.py @@ -5,13 +5,13 @@ class Link(YandexMusicObject): def __init__(self, title, href, - type, + type_, social_network=None, client=None, **kwargs): self.title = title self.href = href - self.type = type + self.type = type_ self.social_network = social_network diff --git a/yandex_music/cover.py b/yandex_music/cover.py index ca6915d..c0da12a 100644 --- a/yandex_music/cover.py +++ b/yandex_music/cover.py @@ -17,10 +17,10 @@ class Cover(YandexMusicObject): Music. Args: - type (:obj:`str`, optional): Тип обложки. + type_ (:obj:`str`, optional): Тип обложки. uri (:obj:`str`, optional): Ссылка на изображение. items_uri (:obj:`str`, optional): Список ссылок на изображения. - dir (:obj:`str`, optional): Директория хранения изображения на сервере. + dir_ (:obj:`str`, optional): Директория хранения изображения на сервере. version (:obj:`str`, optional): Версия. custom (:obj:`bool`, optional): Является ли обложка пользовательской. prefix (:obj:`str`, optional): Уникальный идентификатор. @@ -31,21 +31,21 @@ class Cover(YandexMusicObject): """ def __init__(self, - type=None, + type_=None, uri=None, items_uri=None, - dir=None, + dir_=None, version=None, custom=None, prefix=None, error=None, client=None, **kwargs): - self.type = type + self.type = type_ self.uri = uri self.items_uri = items_uri self.prefix = prefix - self.dir = dir + self.dir = dir_ self.version = version self.custom = custom self.error = error diff --git a/yandex_music/feed/event.py b/yandex_music/feed/event.py index 4369e00..5ae4f08 100644 --- a/yandex_music/feed/event.py +++ b/yandex_music/feed/event.py @@ -3,8 +3,8 @@ from yandex_music import YandexMusicObject class Event(YandexMusicObject): def __init__(self, - id, - type, + id_, + type_, type_for_from=None, title=None, tracks=None, @@ -15,8 +15,8 @@ class Event(YandexMusicObject): tracks_count=None, client=None, **kwargs): - self.id = id - self.type = type + self.id = id_ + self.type = type_ self.type_for_from = type_for_from self.title = title diff --git a/yandex_music/feed/generated_playlist.py b/yandex_music/feed/generated_playlist.py index a8a0e3f..a537a16 100644 --- a/yandex_music/feed/generated_playlist.py +++ b/yandex_music/feed/generated_playlist.py @@ -3,13 +3,13 @@ from yandex_music import YandexMusicObject class GeneratedPlaylist(YandexMusicObject): def __init__(self, - type, + type_, ready, notify, data, client=None, **kwargs): - self.type = type + self.type = type_ self.ready = ready self.notify = notify self.data = data diff --git a/yandex_music/feed/track_with_ads.py b/yandex_music/feed/track_with_ads.py index dcf2c62..86c62a2 100644 --- a/yandex_music/feed/track_with_ads.py +++ b/yandex_music/feed/track_with_ads.py @@ -3,11 +3,11 @@ from yandex_music import YandexMusicObject class TrackWithAds(YandexMusicObject): def __init__(self, - type, + type_, track, client=None, **kwargs): - self.type = type + self.type = type_ self.track = track self.client = client diff --git a/yandex_music/genre/genre.py b/yandex_music/genre/genre.py index c8f7e89..0035e35 100644 --- a/yandex_music/genre/genre.py +++ b/yandex_music/genre/genre.py @@ -3,7 +3,7 @@ from yandex_music import YandexMusicObject class Genre(YandexMusicObject): def __init__(self, - id, + id_, weight, composer_top, title, @@ -18,7 +18,7 @@ class Genre(YandexMusicObject): hide_in_regions=None, client=None, **kwargs): - self.id = id + self.id = id_ self.weight = weight self.composer_top = composer_top self.title = title diff --git a/yandex_music/landing/block.py b/yandex_music/landing/block.py index bd11a3c..a58cf7c 100644 --- a/yandex_music/landing/block.py +++ b/yandex_music/landing/block.py @@ -3,8 +3,8 @@ from yandex_music import YandexMusicObject class Block(YandexMusicObject): def __init__(self, - id, - type, + id_, + type_, type_for_from, title, entities, @@ -13,8 +13,8 @@ class Block(YandexMusicObject): client=None, **kwargs): - self.id = id - self.type = type + self.id = id_ + self.type = type_ self.type_for_from = type_for_from self.title = title self.entities = entities @@ -37,7 +37,7 @@ class Block(YandexMusicObject): from yandex_music import BlockEntity, PlayContextsData, PersonalPlaylistsData data['entities'] = BlockEntity.de_list(data.get('entities'), client) - block_type = data.get('type') + block_type = data.get('type_') if block_type == 'personal-playlists': data['data'] = PersonalPlaylistsData.de_json(data.get('data'), client) elif block_type == 'play-contexts': diff --git a/yandex_music/landing/block_entity.py b/yandex_music/landing/block_entity.py index 8312eaa..76d643c 100644 --- a/yandex_music/landing/block_entity.py +++ b/yandex_music/landing/block_entity.py @@ -15,14 +15,14 @@ de_json = { class BlockEntity(YandexMusicObject): def __init__(self, - id, - type, + id_, + type_, data, client=None, **kwargs): - self.id = id - self.type = type + self.id = id_ + self.type = type_ self.data = data self.client = client @@ -34,7 +34,7 @@ class BlockEntity(YandexMusicObject): return None data = super(BlockEntity, cls).de_json(data, client) - data['data'] = de_json.get(data.get('type'))(data.get('data'), client) + data['data'] = de_json.get(data.get('type_'))(data.get('data'), client) return cls(client=client, **data) diff --git a/yandex_music/landing/track_id.py b/yandex_music/landing/track_id.py index 4762271..1d10694 100644 --- a/yandex_music/landing/track_id.py +++ b/yandex_music/landing/track_id.py @@ -3,11 +3,11 @@ from yandex_music import YandexMusicObject class TrackId(YandexMusicObject): def __init__(self, - id, + id_, album_id=None, client=None, **kwargs): - self.id = id + self.id = id_ self.album_id = album_id self.client = client diff --git a/yandex_music/likes/albums_likes.py b/yandex_music/likes/albums_likes.py index 3e07eb2..11ed75d 100644 --- a/yandex_music/likes/albums_likes.py +++ b/yandex_music/likes/albums_likes.py @@ -4,11 +4,11 @@ from yandex_music import YandexMusicObject class AlbumsLikes(YandexMusicObject): def __init__(self, timestamp, - id=None, + id_=None, album=None, client=None, **kwargs): - self.id = id + self.id = id_ self.album = album self.timestamp = timestamp diff --git a/yandex_music/likes/artists_likes.py b/yandex_music/likes/artists_likes.py index 574b9e1..3c38051 100644 --- a/yandex_music/likes/artists_likes.py +++ b/yandex_music/likes/artists_likes.py @@ -3,12 +3,12 @@ from yandex_music import YandexMusicObject class ArtistsLikes(YandexMusicObject): def __init__(self, - id=None, + id_=None, artist=None, timestamp=None, client=None, **kwargs): - self.id = id + self.id = id_ self.artist = artist self.timestamp = timestamp diff --git a/yandex_music/likes/playlists_likes.py b/yandex_music/likes/playlists_likes.py index c07a257..f68f6e6 100644 --- a/yandex_music/likes/playlists_likes.py +++ b/yandex_music/likes/playlists_likes.py @@ -4,11 +4,11 @@ from yandex_music import YandexMusicObject class PlaylistsLikes(YandexMusicObject): def __init__(self, timestamp, - id=None, + id_=None, playlist=None, client=None, **kwargs): - self.id = id + self.id = id_ self.playlist = playlist self.timestamp = timestamp diff --git a/yandex_music/playlist/user.py b/yandex_music/playlist/user.py index 5a8cb5b..500e376 100644 --- a/yandex_music/playlist/user.py +++ b/yandex_music/playlist/user.py @@ -39,15 +39,15 @@ class User(YandexMusicObject): self.client = client self._id_attrs = (self.uid, self.login) - def download_avatar(self, filename, format='normal'): + def download_avatar(self, filename, format_='normal'): """Загрузка изображения пользователя. 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) + self.client.request.download(f'https://upics.yandex.net/{self.uid}/{format_}', filename) @classmethod def de_json(cls, data, client): diff --git a/yandex_music/rotor/discrete_scale.py b/yandex_music/rotor/discrete_scale.py index ae007e1..286b7df 100644 --- a/yandex_music/rotor/discrete_scale.py +++ b/yandex_music/rotor/discrete_scale.py @@ -3,16 +3,16 @@ from yandex_music import YandexMusicObject class DiscreteScale(YandexMusicObject): def __init__(self, - type, + type_, name, - min, - max, + min_, + max_, client=None, **kwargs): - self.type = type + self.type = type_ self.name = name - self.min = min - self.max = max + self.min = min_ + self.max = max_ self.client = client self._id_attrs = (self.type, self.name, self.min, self.max) @@ -24,7 +24,7 @@ class DiscreteScale(YandexMusicObject): data = super(DiscreteScale, cls).de_json(data, client) from yandex_music import Value - data['min'] = Value.de_json(data.get('min'), client) - data['max'] = Value.de_json(data.get('max'), client) + data['min_'] = Value.de_json(data.get('min_'), client) + data['max_'] = Value.de_json(data.get('max_'), client) return cls(client=client, **data) diff --git a/yandex_music/rotor/enum.py b/yandex_music/rotor/enum.py index 76e8baa..90c74c4 100644 --- a/yandex_music/rotor/enum.py +++ b/yandex_music/rotor/enum.py @@ -3,12 +3,12 @@ from yandex_music import YandexMusicObject class Enum(YandexMusicObject): def __init__(self, - type, + type_, name, possible_values, client=None, **kwargs): - self.type = type + self.type = type_ self.name = name self.possible_values = possible_values diff --git a/yandex_music/rotor/id.py b/yandex_music/rotor/id.py index f9e76a2..17cfe33 100644 --- a/yandex_music/rotor/id.py +++ b/yandex_music/rotor/id.py @@ -3,11 +3,11 @@ from yandex_music import YandexMusicObject class Id(YandexMusicObject): def __init__(self, - type, + type_, tag, client=None, **kwargs): - self.type = type + self.type = type_ self.tag = tag self.client = client diff --git a/yandex_music/rotor/sequence.py b/yandex_music/rotor/sequence.py index 99d0c3e..65425ff 100644 --- a/yandex_music/rotor/sequence.py +++ b/yandex_music/rotor/sequence.py @@ -3,12 +3,12 @@ from yandex_music import YandexMusicObject class Sequence(YandexMusicObject): def __init__(self, - type, + type_, track, liked, client=None, **kwargs): - self.type = type + self.type = type_ self.track = track self.liked = liked diff --git a/yandex_music/rotor/station.py b/yandex_music/rotor/station.py index f22539d..1ce2bcc 100644 --- a/yandex_music/rotor/station.py +++ b/yandex_music/rotor/station.py @@ -36,7 +36,7 @@ class Station(YandexMusicObject): data = super(Station, cls).de_json(data, client) from yandex_music import Id, Icon, Restrictions - data['id'] = Id.de_json(data.get('id'), client) + data['id_'] = Id.de_json(data.get('id_'), client) data['parent_id'] = Id.de_json(data.get('parent_id'), client) data['icon'] = Icon.de_json(data.get('icon'), client) data['mts_icon'] = Icon.de_json(data.get('mts_icon'), client) diff --git a/yandex_music/rotor/station_tracks_result.py b/yandex_music/rotor/station_tracks_result.py index ca6e8df..cf13d5c 100644 --- a/yandex_music/rotor/station_tracks_result.py +++ b/yandex_music/rotor/station_tracks_result.py @@ -3,13 +3,13 @@ from yandex_music import YandexMusicObject class StationTracksResult(YandexMusicObject): def __init__(self, - id, + id_, sequence, batch_id, pumpkin, client=None, **kwargs): - self.id = id + self.id = id_ self.sequence = sequence self.batch_id = batch_id self.pumpkin = pumpkin @@ -24,7 +24,7 @@ class StationTracksResult(YandexMusicObject): data = super(StationTracksResult, cls).de_json(data, client) from yandex_music import Id, Sequence - data['id'] = Id.de_json(data.get('id'), client) + data['id_'] = Id.de_json(data.get('id_'), client) data['sequence'] = Sequence.de_list(data.get('sequence'), client) return cls(client=client, **data) diff --git a/yandex_music/search/best.py b/yandex_music/search/best.py index fb25dbf..cd194ba 100644 --- a/yandex_music/search/best.py +++ b/yandex_music/search/best.py @@ -12,12 +12,12 @@ de_json_result = { class Best(YandexMusicObject): def __init__(self, - type, + type_, result, text=None, client=None, **kwargs): - self.type = type + self.type = type_ self.result = result self.text = text @@ -31,6 +31,6 @@ class Best(YandexMusicObject): return None data = super(Best, cls).de_json(data, client) - data['result'] = de_json_result.get(data.get('type'))(data.get('result'), client) + data['result'] = de_json_result.get(data.get('type_'))(data.get('result'), client) return cls(client=client, **data) diff --git a/yandex_music/search/search_result.py b/yandex_music/search/search_result.py index 2a4d164..8ca3bbd 100644 --- a/yandex_music/search/search_result.py +++ b/yandex_music/search/search_result.py @@ -27,11 +27,11 @@ class SearchResult(YandexMusicObject): self._id_attrs = (self.total, self.per_page, self.order, self.results) @classmethod - def de_json(cls, data, client, type=None): + def de_json(cls, data, client, type_=None): if not data: return None data = super(SearchResult, cls).de_json(data, client) - data['results'] = de_json_result.get(type)(data.get('results'), client) + data['results'] = de_json_result.get(type_)(data.get('results'), client) return cls(client=client, **data) diff --git a/yandex_music/status/account.py b/yandex_music/status/account.py index 4eca212..7aee150 100644 --- a/yandex_music/status/account.py +++ b/yandex_music/status/account.py @@ -82,15 +82,15 @@ class Account(YandexMusicObject): if self.uid: self._id_attrs = (self.uid,) - def download_avatar(self, filename, format='normal'): + def download_avatar(self, filename, format_='normal'): """Загрузка изображения пользователя. 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) + self.client.request.download(f'https://upics.yandex.net/{self.uid}/{format_}', filename) @classmethod def de_json(cls, data, client): diff --git a/yandex_music/status/product.py b/yandex_music/status/product.py index 1a40067..39f0b08 100644 --- a/yandex_music/status/product.py +++ b/yandex_music/status/product.py @@ -26,7 +26,7 @@ class Product(YandexMusicObject): Args: product_id (:obj:`str`): Уникальный идентификатор. - type (:obj:`str`): Тип продаваемого. + type_ (:obj:`str`): Тип продаваемого. common_period_duration (:obj:`str`): Длительность общего периода. duration (:obj:`int`): Длительность. trial_duration (:obj:`int`): Длительность испытательного срока. @@ -48,7 +48,7 @@ class Product(YandexMusicObject): def __init__(self, product_id, - type, + type_, common_period_duration, duration, trial_duration, @@ -66,7 +66,7 @@ class Product(YandexMusicObject): client=None, **kwargs): self.product_id = product_id - self.type = type + self.type = type_ self.common_period_duration = common_period_duration self.duration = duration self.trial_duration = trial_duration diff --git a/yandex_music/supplement/lyrics.py b/yandex_music/supplement/lyrics.py index 5132362..b9efea6 100644 --- a/yandex_music/supplement/lyrics.py +++ b/yandex_music/supplement/lyrics.py @@ -15,7 +15,7 @@ class Lyrics(YandexMusicObject): Music. Args: - id (:obj:`int`): Уникальный идентификатор текста трека. + id_ (:obj:`int`): Уникальный идентификатор текста трека. lyrics (:obj:`str`): Первые строки текст песни. has_rights (:obj:`bool`): Есть ли права. full_lyrics (:obj:`str`): Текст песни. @@ -27,7 +27,7 @@ class Lyrics(YandexMusicObject): """ def __init__(self, - id, + id_, lyrics, full_lyrics, has_rights, @@ -35,7 +35,7 @@ class Lyrics(YandexMusicObject): show_translation, client=None, **kwargs): - self.id = id + self.id = id_ self.lyrics = lyrics self.full_lyrics = full_lyrics self.has_rights = has_rights @@ -60,7 +60,7 @@ class Lyrics(YandexMusicObject): """ if not data: return None - + data = super(Lyrics, cls).de_json(data, client) return cls(client=client, **data) diff --git a/yandex_music/supplement/supplement.py b/yandex_music/supplement/supplement.py index 218a6af..0583bba 100644 --- a/yandex_music/supplement/supplement.py +++ b/yandex_music/supplement/supplement.py @@ -14,7 +14,7 @@ class Supplement(YandexMusicObject): Music. Args: - id (:obj:`int`): Уникальный идентификатор дополнительной информации. + id_ (:obj:`int`): Уникальный идентификатор дополнительной информации. lyrics (:obj:`yandex_music.Lyrics`): Объект класса :class:`yandex_music.Lyrics` представляющий текст песни. videos (:obj:`yandex_music.VideoSupplement`): Объект класса :class:`yandex_music.VideoSupplement` представляющий видео. @@ -25,13 +25,13 @@ class Supplement(YandexMusicObject): """ def __init__(self, - id, + id_, lyrics, videos, radio_is_available, client=None, **kwargs): - self.id = id + self.id = id_ self.lyrics = lyrics self.videos = videos self.radio_is_available = radio_is_available @@ -53,7 +53,7 @@ class Supplement(YandexMusicObject): """ if not data: return None - + data = super(Supplement, cls).de_json(data, client) from yandex_music import Lyrics, VideoSupplement data['lyrics'] = Lyrics.de_json(data.get('lyrics'), client) diff --git a/yandex_music/track/major.py b/yandex_music/track/major.py index 78e85d3..9f5009f 100644 --- a/yandex_music/track/major.py +++ b/yandex_music/track/major.py @@ -3,11 +3,11 @@ from yandex_music import YandexMusicObject class Major(YandexMusicObject): def __init__(self, - id, + id_, name, client=None, **kwargs): - self.id = id + self.id = id_ self.name = name self.client = client diff --git a/yandex_music/track/track.py b/yandex_music/track/track.py index 6569e64..d219b88 100644 --- a/yandex_music/track/track.py +++ b/yandex_music/track/track.py @@ -3,7 +3,7 @@ from yandex_music import YandexMusicObject class Track(YandexMusicObject): def __init__(self, - id, + id_, title, available, artists, @@ -12,7 +12,7 @@ class Track(YandexMusicObject): lyrics_available=None, real_id=None, og_image=None, - type=None, + type_=None, cover_uri=None, major=None, duration_ms=None, @@ -28,7 +28,7 @@ class Track(YandexMusicObject): available_full_without_permission=None, client=None, **kwargs): - self.id = id + self.id = id_ self.title = title self.available = available self.artists = artists @@ -38,7 +38,7 @@ class Track(YandexMusicObject): self.lyrics_available = lyrics_available self.real_id = real_id self.og_image = og_image - self.type = type + self.type = type_ self.cover_uri = cover_uri self.major = major self.duration_ms = duration_ms diff --git a/yandex_music/track_short.py b/yandex_music/track_short.py index b35cfef..187bdfc 100644 --- a/yandex_music/track_short.py +++ b/yandex_music/track_short.py @@ -12,7 +12,7 @@ class TrackShort(YandexMusicObject): Music. Args: - id (:obj:`str`): Уникальный идентификатор трека. + id_ (:obj:`str`): Уникальный идентификатор трека. timestamp (:obj:`str`): Дата TODO. album_id (:obj:`str`, optional): Уникальный идентификатор альбома. client (:obj:`yandex_music.Client`, optional): Объект класса :class:`yandex_music.Client` представляющий клиент @@ -21,12 +21,12 @@ class TrackShort(YandexMusicObject): """ def __init__(self, - id, + id_, timestamp, album_id=None, client=None, **kwargs): - self.id = id + self.id = id_ self.timestamp = timestamp self.album_id = album_id