Skip to main content

Unofficial API for YouTube Music

Project description

PyPI Downloads Ask questions at https://gitter.im/sigma67/ytmusicapi Code coverage Latest release Commits since latest release

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

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:

If you find something missing or broken, check the FAQ or feel free to create an issue.

Requirements

Setup

See the Documentation for detailed instructions

Usage

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 are also a great source of usage examples.

Contributing

Pull requests are welcome. There are still some features that are not yet implemented. Please, refer to CONTRIBUTING.rst for guidance.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ytmusicapi-1.12.1.tar.gz (529.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ytmusicapi-1.12.1-py3-none-any.whl (108.6 kB view details)

Uploaded Python 3

File details

Details for the file ytmusicapi-1.12.1.tar.gz.

File metadata

  • Download URL: ytmusicapi-1.12.1.tar.gz
  • Upload date:
  • Size: 529.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ytmusicapi-1.12.1.tar.gz
Algorithm Hash digest
SHA256 4e33f424db311ece1b9e5f29a51ade46b0697f6e2f284f8a40bcbd7219772755
MD5 f7da3be52828596836ec45d15968c5c5
BLAKE2b-256 8a16f9737ae3a565abaf2e3d106507272f85e43abff6886fb514a22db3a8adaf

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytmusicapi-1.12.1.tar.gz:

Publisher: pythonpublish.yml on sigma67/ytmusicapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ytmusicapi-1.12.1-py3-none-any.whl.

File metadata

  • Download URL: ytmusicapi-1.12.1-py3-none-any.whl
  • Upload date:
  • Size: 108.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ytmusicapi-1.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a53f6df504b97b93a4d41c804b699b46190207cb9d864fcf4edeb338b1f15d9
MD5 180136f2b8dc369da44067e9544c9e4f
BLAKE2b-256 536df7156e7ab9953d09e14ef538de4e92c484169fac19d207b19b9d9eb9c845

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytmusicapi-1.12.1-py3-none-any.whl:

Publisher: pythonpublish.yml on sigma67/ytmusicapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page