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.0.tar.gz (434.6 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.0-py3-none-any.whl (107.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ytmusicapi-1.12.0.tar.gz
  • Upload date:
  • Size: 434.6 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.0.tar.gz
Algorithm Hash digest
SHA256 9a466e633c43e90025b4c3dfa862f0f5677af4eacc8d2052ef9fc8f48cd65140
MD5 2cad819f0b0a39caf9754fa1b31a40d4
BLAKE2b-256 4f16728305b1e6d100f2f2c696f6de08b3717f3db323bd666a8246397d70bcad

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytmusicapi-1.12.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: ytmusicapi-1.12.0-py3-none-any.whl
  • Upload date:
  • Size: 107.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4130a3a7a0ab56eeeff33b343c8cf4a2f4ea14c206d96c221a7646ab0e61ebc8
MD5 6faa9c37f21ab3647ce5c942f1347b30
BLAKE2b-256 3d209f1b0ff4c9ed441b2181259ff9c0250a9999ec811b08fe45627842453092

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytmusicapi-1.12.0-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