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.11.5.tar.gz (413.0 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.11.5-py3-none-any.whl (102.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ytmusicapi-1.11.5.tar.gz
Algorithm Hash digest
SHA256 48f35901291c8af9934ec0aa9cd6b9fd1a19c543f843c39c9e8b396356b47801
MD5 2a149d19cc110754b7a739b7ab036da8
BLAKE2b-256 ac4ba44292f732903dc26a90236ad1cf284da974ed5491df388cf15713b38429

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for ytmusicapi-1.11.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f6b1e031408cce45bef207bfda449e3ecf548f7c4ff0c091c575d4a27eb21da6
MD5 7c62fe0b0a4427169a60e9175c43b3ec
BLAKE2b-256 aaa88feb17eaa8b2bf36b0617ba37f949a7036b6ece652672bd4517a54326f0e

See more details on using hashes here.

Provenance

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