Skip to main content

A YouTube Music Search Package With Artist, Channel, and Video Details

Project description

YouTubeMusic 🔥

A blazing fast YouTube music search module using DuckDuckGo scraping.

Features

  • No YouTube API needed ✅
  • Fast + lightweight async search engine ⚡
  • Perfect for Telegram bots, CLI tools, and more 🎧

Install

pip install YouTubeMusic

How To Install

# Search By YouTube Search API
from YouTubeMusic.YtSearch import Search

# Search Using Httpx And Re
from YouTubeMusic.Search import Search

Example Usage

from YouTubeMusic.Search import Search
#from YouTubeMusic.YtSearch import Search

async def SearchYt(query: str):
    results = await Search(query, limit=1)

    if not results or not results.get("main_results"):
        raise Exception("No results found.")

    item = results["main_results"][0] 

    search_data = [{
        "title": item.get("title"),
        "artist": item.get("artist_name"),
        "channel": item.get("channel_name"),
        "duration": item.get("duration"),
        "views": item.get("views"),
        "thumbnail": item.get("thumbnail"),
        "url": item.get("url")
    }]

    song_url = item["url"] 

    return search_data, song_url

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

youtubemusic-8.1.0.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

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

youtubemusic-8.1.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file youtubemusic-8.1.0.tar.gz.

File metadata

  • Download URL: youtubemusic-8.1.0.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for youtubemusic-8.1.0.tar.gz
Algorithm Hash digest
SHA256 44fc3796a838117b23a3b1ea309d7cff7a1e3318ca34a8918a874dc8437ae7b1
MD5 f44c58cd6f95d2a7b88b706a9f6be19e
BLAKE2b-256 915424fd0d23f12c3c8540385604cf06af4ccc80df03f461f5811027c59f61a2

See more details on using hashes here.

File details

Details for the file youtubemusic-8.1.0-py3-none-any.whl.

File metadata

  • Download URL: youtubemusic-8.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for youtubemusic-8.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c647ebae014175f5c9fb914ad1fd34194645c377f1e2a1ef3ea21ed0ed680b0a
MD5 86cd8ce5c33a540b9982a60f3d1a8ce0
BLAKE2b-256 17b0933760557dfef0dd7d440e786ebacffec1e0657218292142f80045dedfe2

See more details on using hashes here.

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