No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
github-actions[bot] d5653b76e1
chore: Update pdm.lock (#579)
* chore: Update pdm.lock

* update precommit config

---------

Co-authored-by: sigma67 <16363825+sigma67@users.noreply.github.com>
Co-authored-by: sigma67 <sigma67.github@gmail.com>
2024-07-03 22:29:00 +02:00
.github fix some more tests 2024-07-03 22:05:50 +02:00
docs get_episodes_playlist (#561) 2024-03-08 21:32:09 +01:00
tests fix some more tests 2024-07-03 22:05:50 +02:00
ytmusicapi fix sum_total_duration failing if duration_seconds is not an int (#598) 2024-07-03 22:23:03 +02:00
.gitignore fix #544 (#560) 2024-04-05 20:53:32 +02:00
.pre-commit-config.yaml chore: Update pdm.lock (#579) 2024-07-03 22:29:00 +02:00
.readthedocs.yml .readthedocs.yml: enable all formats 2023-12-14 13:53:29 +01:00
CONTRIBUTING.rst add mypy 2023-12-31 20:13:45 +01:00
LICENSE update LICENSE year to 2024 2024-01-03 21:19:01 +01:00
pdm.lock chore: Update pdm.lock (#579) 2024-07-03 22:29:00 +02:00
pyproject.toml podcasts features ✨ (#559) 2024-03-06 23:02:19 +01:00
README.rst Update README.rst 2024-05-04 13:34:42 +02:00

ytmusicapi: Unofficial API for YouTube Music
############################################

.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/ytmusicapi?style=flat-square
    :alt: PyPI Downloads
    :target: https://pypi.org/project/ytmusicapi/

.. |gitter| image:: https://badges.gitter.im/sigma67/ytmusicapi.svg
   :alt: Ask questions at https://gitter.im/sigma67/ytmusicapi
   :target: https://gitter.im/sigma67/ytmusicapi

.. |code-coverage| image:: https://img.shields.io/codecov/c/github/sigma67/ytmusicapi?style=flat-square
    :alt: Code coverage
    :target: https://codecov.io/gh/sigma67/ytmusicapi

.. |latest-release| image:: https://img.shields.io/github/v/release/sigma67/ytmusicapi?style=flat-square
    :alt: Latest release
    :target: https://github.com/sigma67/ytmusicapi/releases/latest

.. |commits-since-latest| image:: https://img.shields.io/github/commits-since/sigma67/ytmusicapi/latest?style=flat-square
    :alt: Commits since latest release
    :target: https://github.com/sigma67/ytmusicapi/commits


|pypi-downloads| |gitter| |code-coverage| |latest-release| |commits-since-latest|

ytmusicapi is a Python 3 library to send requests to the YouTube Music API.
It emulates YouTube Music web client requests using the user's cookie data for authentication.

.. features

Features
--------

| **Browsing**:

* search (including all filters) and suggestions
* get artist information and releases (songs, videos, albums, singles, related artists)
* get user information (videos, playlists)
* get albums
* get song metadata
* get watch playlists (next songs when you press play/radio/shuffle in YouTube Music)
* get song lyrics

| **Exploring music**:

* get moods and genres playlists
* get latest charts (globally and per country)

| **Library management**:

* get library contents: playlists, songs, artists, albums and subscriptions, podcasts, channels
* add/remove library content: rate songs, albums and playlists, subscribe/unsubscribe artists
* get and modify play history

| **Playlists**:

* create and delete playlists
* modify playlists: edit metadata, add/move/remove tracks
* get playlist contents
* get playlist suggestions

| **Podcasts**:

* get podcasts
* get episodes
* get channels
* get episodes playlists

| **Uploads**:

* upload songs and remove them again
* list uploaded songs, artists and albums

| **Localization**:

* all regions are supported (see `locations FAQ <https://ytmusicapi.readthedocs.io/en/stable/faq.html#which-values-can-i-use-for-locations>`__
* 16 languages are supported (see `languages FAQ <https://ytmusicapi.readthedocs.io/en/stable/faq.html#which-values-can-i-use-for-languages>`__


If you find something missing or broken,
check the `FAQ <https://ytmusicapi.readthedocs.io/en/stable/faq.html>`__ or
feel free to create an `issue <https://github.com/sigma67/ytmusicapi/issues/new/choose>`__.

Requirements
------------

- Python 3.8 or higher - https://www.python.org

Setup
-----

See the `Documentation <https://ytmusicapi.readthedocs.io/en/stable/usage.html>`_ for detailed instructions

Usage
------
.. code-block:: python

    from ytmusicapi import YTMusic

    yt = YTMusic('oauth.json')
    playlistId = yt.create_playlist('test', 'test description')
    search_results = yt.search('Oasis Wonderwall')
    yt.add_playlist_items(playlistId, [search_results[0]['videoId']])

The `tests <https://github.com/sigma67/ytmusicapi/blob/master/tests/>`_ are also a great source of usage examples.

.. end-features

Contributing
------------

Pull requests are welcome. There are still some features that are not yet implemented.
Please, refer to `CONTRIBUTING.rst <https://github.com/sigma67/ytmusicapi/blob/master/CONTRIBUTING.rst>`_ for guidance.