Skip to content

Commit be619b1

Browse files
authored
Update README.rst
1 parent 6ac7901 commit be619b1

File tree

1 file changed

+9
-27
lines changed

1 file changed

+9
-27
lines changed

README.rst

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,7 @@
11
ytmusicapi: Unofficial API for YouTube Music
22
############################################
33

4-
.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/ytmusicapi?style=flat-square
5-
:alt: PyPI Downloads
6-
:target: https://pypi.org/project/ytmusicapi/
7-
8-
.. |gitter| image:: https://badges.gitter.im/sigma67/ytmusicapi.svg
9-
:alt: Ask questions at https://gitter.im/sigma67/ytmusicapi
10-
:target: https://gitter.im/sigma67/ytmusicapi
11-
12-
.. |code-coverage| image:: https://img.shields.io/codecov/c/github/sigma67/ytmusicapi?style=flat-square
13-
:alt: Code coverage
14-
:target: https://codecov.io/gh/sigma67/ytmusicapi
15-
16-
.. |latest-release| image:: https://img.shields.io/github/v/release/sigma67/ytmusicapi?style=flat-square
17-
:alt: Latest release
18-
:target: https://github.com/sigma67/ytmusicapi/releases/latest
19-
20-
.. |commits-since-latest| image:: https://img.shields.io/github/commits-since/sigma67/ytmusicapi/latest?style=flat-square
21-
:alt: Commits since latest release
22-
:target: https://github.com/sigma67/ytmusicapi/commits
23-
24-
25-
|pypi-downloads| |gitter| |code-coverage| |latest-release| |commits-since-latest|
4+
This is an async prototype of `ytmusicapi <https://github.com/sigma67/ytmusicapi>`_. Use with caution.
265

276
ytmusicapi is a Python 3 library to send requests to the YouTube Music API.
287
It emulates YouTube Music web client requests using the user's cookie data for authentication.
@@ -96,12 +75,15 @@ Usage
9675
------
9776
.. code-block:: python
9877
99-
from ytmusicapi import YTMusic
78+
import ytmusicapi
79+
import asyncio
80+
81+
async def main():
82+
ytm = ytmusicapi.YTMusic()
83+
results = await ytm.search("coldpaly", filter="songs", limit=1)
84+
print(results)
10085
101-
yt = YTMusic('oauth.json')
102-
playlistId = yt.create_playlist('test', 'test description')
103-
search_results = yt.search('Oasis Wonderwall')
104-
yt.add_playlist_items(playlistId, [search_results[0]['videoId']])
86+
asyncio.run(main())
10587
10688
The `tests <https://github.com/sigma67/ytmusicapi/blob/master/tests/>`_ are also a great source of usage examples.
10789

0 commit comments

Comments
 (0)