Skip to main content

An unofficial YouTube Music API For Python Programming Language.

Project description

YouTubeMusicAPI

What's new in version 2.4?

  • Stable release.
  • New searchUrls() function added.

About

  • An unofficial YouTube Music API For Python Programming Language.
  • A Python library which Quickly gather the metadata of a Song, Playlist existing on YouTube or YouTube Music.
  • No Access token or Credentials required.

Package Installation

  • Windows

pip install --upgrade YouTubeMusicAPI==2.4

  • Linux & Mac OS

pip3 install --upgrade YouTubeMusicAPI==2.4

GET Basic

  • track()

This function can be used to get metadata of a track or song.

from YouTubeMusicAPI import YouTubeMusicAPI

track = YouTubeMusicAPI().track("immortals")

print(track)

# output

{
    'name': 'Fall Out Boy - Immortals (Official Music Video) (From "Big Hero 6")', 
    'datePublished': '2014-10-13', 
    'Id': 'l9PxOanFjxQ', 
    'url': 'https://music.youtube.com/watch?v=l9PxOanFjxQ', 
    'image': 'https://i.ytimg.com/vi/l9PxOanFjxQ/hqdefault.jpg'
}

  • playlist()

This function can be used to get metadata of a playlist.

from YouTubeMusicAPI import YouTubeMusicAPI

playlist = YouTubeMusicAPI().playlist("Alan Walker")

print(playlist)

# output

{
    'name': 'Alan Walker - Teledyski', 
    'url': 'https://music.youtube.com/playlist?list=PLwcXu6NozQZjVjazNF0fqbdQ8e15mnMJ4', 
    'Id': 'PLwcXu6NozQZjVjazNF0fqbdQ8e15mnMJ4'
}
  • searchUrls()

This function can be used to get all result urls based on query.

from YouTubeMusicAPI import YouTubeMusicAPI

urls = YouTubeMusicAPI().searchUrls("alone")

print(urls)

#output

[
    'https://music.youtube.com/watch?v=bPs0xFd4skY',
    'https://music.youtube.com/watch?v=TCFuCCY-pxc',
    'https://music.youtube.com/watch?v=ciwx8yJPX54',
    'https://music.youtube.com/watch?v=aZwklvDdaVw',
    'https://music.youtube.com/watch?v=ALZHF5UqnU4',
    'https://music.youtube.com/watch?v=KDzL80906Xo',
    'https://music.youtube.com/watch?v=HhjHYkPQ8F0'
]

Author

License

Contributing

  • For major changes or improvement, Open an issue and mention what you would like to change or add.

Project details


Download files

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

Source Distribution

YouTubeMusicAPI-2.4.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

YouTubeMusicAPI-2.4-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

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