The YouTube Music search scraper for the Python programming language.
Project description
YouTube Music API
An unofficial YouTube Music search API
Installation
- Python 3.9 or later is required.
- make sure that the latest pip version is installed in your working environment.
pip install -U pip
- Run the following command given below to install the package:
pip install -U YouTubeMusicAPI
Usage
To use this package, you need to import it in your Python program and call the search
function with a query string as an argument. The function will return a dictionary object with the following keys:
title
: The title of the song.id
: The id of the song on YouTube Music.url
: The url of the song on YouTube Music.artwork
: The url of the artwork image of the song.author
: A dictionary object with two keys: name and url, which represent the name and url of the author of the song.
If no result is found for your query, the function will return None.
Example
Here is an example of how to use this package to search by song name.
import YouTubeMusicAPI
query: str = "alan walker faded"
result = YouTubeMusicAPI.search(query)
if result:
print(result)
else:
print("No Result Found")
Output:
{
"title": "Alan Walker - Faded",
"id": "60ItHLz5WEA",
"url": "https://music.youtube.com/watch?v=60ItHLz5WEA",
"artwork": "https://img.youtube.com/vi/60ItHLz5WEA/0.jpg",
"author": {
"name": "Alan Walker",
"url": "https://www.youtube.com/@Alanwalkermusic"
}
}
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
YouTubeMusicAPI-2.8.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for YouTubeMusicAPI-2.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3416ad11c9ee958f877febae95946be5afe7746f6a1e92b1647132aca350b33a |
|
MD5 | 129ff4ee7672b41a2ea4f33183a3edb5 |
|
BLAKE2b-256 | 2cae02c8f4af8264115eb8faf9ab6afd8666b378102a69c9aff0e8c27d94c58a |