15 stable releases

2.3.0 Aug 17, 2024
2.2.1 Jun 22, 2024
2.2.0 Feb 9, 2024
2.1.0 Dec 27, 2023
1.1.0 Oct 6, 2022

#165 in Audio

Download history 119/week @ 2024-08-15 5/week @ 2024-08-22 11/week @ 2024-09-12 44/week @ 2024-09-19 37/week @ 2024-09-26 8/week @ 2024-10-03

1,143 downloads per month

MIT/Apache

27KB
447 lines

A library for fetching Youtube Music metadata

currently, these features are included:

  • searching for an artist by name
  • getting an artist's singles and albums
  • listing tracks and their ids from an album

this library was inspired by youtube-music-api written in javascript

Code examples

    // Request configs from youtube music
    let client = Client::init().await.unwrap();
    
    // Get an album from the first artist in the search results
    let album = client.search_artists("Tři sestry").await.unwrap()
    [0].request(&client).await.unwrap()
    .albums[0].request(&client).await.unwrap();
    
    println!("first album: {:#?}", album);
    // Request configs from youtube music
    let client = Client::init().await.unwrap();
    
    // Get an album from the first artist in the search results

    // Search for an artist
    let search_results = client.search_artists(QUERY).await.unwrap();

    // Get the first result
    let artist = client.get_artist(&search_results[0].browse_id).await.unwrap();

    // Get it's first album
    let album = client.get_album(&artist.albums[0].browse_id).await.unwrap();
    
    println!("first album: {:#?}", album);

Dependencies

~7–18MB
~256K SLoC