Skip to content

Commit

Permalink
Merge pull request #157 from MarshalX/development
Browse files Browse the repository at this point in the history
v0.0.15
  • Loading branch information
MarshalX authored Dec 1, 2019
2 parents b596fe5 + 488f764 commit d4d2348
Show file tree
Hide file tree
Showing 39 changed files with 678 additions and 157 deletions.
50 changes: 49 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,54 @@
Список изменений
================

Версия 0.0.15
=============

**01.12.2019**

**Переломные изменения**

- У классов ``Artist``, ``Track`` и ``Playlist`` изменился перечень полей для генерации хеша.

**Крупные изменения**

- Добавлена возможность выполнять запросы через прокси-сервер для использовании библиотеки на зарубежных серверах (`#139`_).
- Добавлен пример использования в ``README``.
- Добавлена обработка капчи при авторизации с возможностью использования callback-функции для её обработки (`#140`_):
- Новые исключения:
- Captcha:
- CaptchaRequired.
- CaptchaWrong.
- Новые классы:
- CaptchaResponse.
- Новые примеры в ``README``:
- Пример обработки с использованием callback-функции.
- Пример полностью своей обработки капчи.
- Добавлена документация для класса ``Search`` (`#83`_).
- Добавлена возможность получения всех альбомов исполнителя (`#141`_):
- Новые классы:
- ArtistAlbums.
- Новые методы:
- ``artists_direct_albums`` у ``Client``.
- ``get_albums`` у ``Artist``.
- Добавлена обработка несуществующего плейлиста (`#147`_):
- Новые классы:
- ``PlaylistAbsence``.

**Незначительные изменения и/или исправления**

- Исправлен баг с загрузкой файлов (`#149`_).
- Исправлен баг некорректной десериализации плейлиста при отсутствии прав на него (`#147`_).
- Исправлен баг неправильной десериализации треков и артистов у собственных загруженных файлов (`#154`_).

.. _`#139`: https://github.com/MarshalX/yandex-music-api/issues/139
.. _`#140`: https://github.com/MarshalX/yandex-music-api/issues/140
.. _`#83`: https://github.com/MarshalX/yandex-music-api/issues/83
.. _`#141`: https://github.com/MarshalX/yandex-music-api/issues/141
.. _`#149`: https://github.com/MarshalX/yandex-music-api/issues/149
.. _`#147`: https://github.com/MarshalX/yandex-music-api/issues/147
.. _`#154`: https://github.com/MarshalX/yandex-music-api/issues/154

Версия 0.0.14
=============

Expand All @@ -26,7 +74,7 @@
**Незначительные изменения и/или исправления**

- Поле ``cover_uri`` класса ``Album`` теперь опциональное.
- Поле ``region`` у класса Account теперь не обязательное.
- Поле ``region`` у класса ``Account`` теперь не обязательное.
- Исправлен баг в ``.to_dict()`` методе, связанный с десериализцией объектов списков и словарей.
- Исправлен баг в ``.to_dict()`` методе, связанный с не рекурсивной десериализацией.
- Исправлена десериализация ``similar_artists`` в ``BriefInfo``.
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pytest-cov = "*"
codecov = "*"

[packages]
requests = "*"
requests = { extras = ["socks"] }

[requires]
python_version = "3.7"
48 changes: 35 additions & 13 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,52 @@ Microsoft Store. Так как API является закрытым и испо
Первым треком из примера является следующий трек:
music.yandex.ru/album/**1193829**/track/**10994777**

Выполнение запросов с использование прокси:

.. code:: python
from yandex_music.utils.request import Request
from yandex_music.client import Client
request = Request(proxy_url='socks5://user:password@host:port')
client = Client(request=request)
Примеры proxy url:

- socks5://user:password@host:port
- http://host:port
- https://host:port
- http://user:password@host

Больше примеров тут: `proxies - advanced usage - requests <https://2.python-requests.org/en/master/user/advanced/#proxies>`_

Пример инициализации клиента с обработкой капчи:

.. code:: python
def init_client():
client = captcha_key = captcha_answer = None
while not client:
try:
client = Client.from_credentials('login', 'pass', captcha_answer, captcha_key)
except Captcha as e:
e.captcha.download('captcha.png')
captcha_key = e.captcha.x_captcha_key
captcha_answer = input('Число с картинки: ')
return client
Пример инициализации клиента с обработкой капчи при помощи callback-функции:

.. code:: python
def proc_captcha(captcha):
captcha.download('captcha.png')
return input('Число с картинки: ')
client = Client.from_credentials('login', 'pass', captcha_callback=proc_captcha)
--------------------
Изучение по примерам
--------------------
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

| Версия | Поддержка |
| ------- | ------------------ |
| 0.0.13 | :white_check_mark: |
| < 0.0.13 | :x: |
| 0.0.15 | :white_check_mark: |
| < 0.0.15 | :x: |

## Сообщение об уязвимости

Expand Down
7 changes: 7 additions & 0 deletions docs/source/yandex_music.artist.artist_albums.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
yandex_music.ArtistAlbums
=========================

.. autoclass:: yandex_music.ArtistAlbums
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions docs/source/yandex_music.artist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
yandex_music.artist.description
yandex_music.artist.brief_info
yandex_music.artist.artist_tracks
yandex_music.artist.artist_albums
yandex_music.artist.pager
7 changes: 7 additions & 0 deletions docs/source/yandex_music.playlist.playlist_absence.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
yandex_music.PlaylistAbsence
============================

.. autoclass:: yandex_music.PlaylistAbsence
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions docs/source/yandex_music.playlist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
yandex_music.playlist.user
yandex_music.playlist.made_for
yandex_music.playlist.play_counter
yandex_music.playlist.playlist_absence
yandex_music.playlist.playlist
yandex_music.playlist.case_forms
yandex_music.playlist.playlist_id
7 changes: 0 additions & 7 deletions docs/source/yandex_music.search.album_search_result.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/yandex_music.search.artist_search_result.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/yandex_music.search.playlist_search_result.rst

This file was deleted.

5 changes: 0 additions & 5 deletions docs/source/yandex_music.search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
.. toctree::

yandex_music.search.suggestions
yandex_music.search.track_search_result
yandex_music.search.search
yandex_music.search.artist_search_result
yandex_music.search.search_result
yandex_music.search.video_search_result
yandex_music.search.best
yandex_music.search.playlist_search_result
yandex_music.search.album_search_result
7 changes: 0 additions & 7 deletions docs/source/yandex_music.search.track_search_result.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/yandex_music.search.video_search_result.rst

This file was deleted.

7 changes: 7 additions & 0 deletions docs/source/yandex_music.utils.captcha_response.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
yandex_music.utils.captcha_response.CaptchaResponse
===================================================

.. autoclass:: yandex_music.utils.captcha_response.CaptchaResponse
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions docs/source/yandex_music.utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

yandex_music.utils.request
yandex_music.utils.response
yandex_music.utils.captcha_response
yandex_music.utils.difference
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
requests
requests[socks]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def requirements():

with open('README.rst', 'r', encoding='utf-8') as f:
setup(name='yandex-music',
version='0.0.14',
version='0.0.15',
author='Il`ya Semyonov',
author_email='[email protected]',
license='LGPLv3',
Expand Down
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from .test_play_contexts_data import TestPlayContextsData
from .test_play_counter import TestPlayCounter
from .test_playlist import TestPlaylist
from .test_playlist_absence import TestPlaylistAbsence
from .test_playlist_id import TestPlaylistId
from .test_playlist_id import TestPlaylistId
from .test_plus import TestPlus
Expand Down
Loading

0 comments on commit d4d2348

Please sign in to comment.