From 0882aaebec904ff0577b3dbf838fbabfa64ffe6d Mon Sep 17 00:00:00 2001 From: Angelovich Date: Sat, 26 Dec 2020 15:15:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B0=D0=B4=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D1=81=D0=B0=20=D0=B8=D0=BA=D0=BE=D0=BD=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yandex_music/icon.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/yandex_music/icon.py b/yandex_music/icon.py index bca5c64..edf3524 100644 --- a/yandex_music/icon.py +++ b/yandex_music/icon.py @@ -41,7 +41,15 @@ class Icon(YandexMusicObject): filename (:obj:`str`): Путь для сохранения файла с названием и расширением. size (:obj:`str`, optional): Размер иконки. """ - self.client.request.download(f'https://{self.image_url.replace("%%", size)}', filename) + self.client.request.download(self.get_url(size), filename) + + def get_url(self, size: str = '200x200'): + """Получение URL иконки. + + Args: + size (:obj:`str`, optional): Размер иконки. + """ + return f'https://{self.image_url.replace("%%", size)}' @classmethod def de_json(cls, data: dict, client: 'Client') -> Optional['Icon']: