#search-query #music #wave #fetch #vec #retrieve #api

yanked wirewave

Use WireWay's Wave API to fetch music by search query

5 releases

0.1.4 Jul 30, 2024
0.1.3 Jul 23, 2024
0.1.2 Jul 23, 2024
0.1.1 Jul 22, 2024
0.1.0 Jul 22, 2024

#341 in Audio

Download history 52/week @ 2024-07-16 239/week @ 2024-07-23 131/week @ 2024-07-30 2/week @ 2024-09-10 24/week @ 2024-09-24 4/week @ 2024-10-01

201 downloads per month

MIT license

8KB
60 lines

WireWave

Use Wave API Wave API to fetch music by search query

Example:

Get Music vec by search query:

let music_items = WaveMusic::new("example search term".to_string());
for item in music_items.unwrap() {
    println!("{}", item);
}

Get and save thumpnail from music:

let music_items = WaveMusic::new("example search term".to_string()).unwrap();
if let Some(item) = music_items.first() {
    let mut thumbnail_response = item.thumbnail().unwrap();
    let name = format!("{}.png", item.id.as_ref().unwrap());
    let path = Path::new(&name);
    let mut file = File::create(&path).unwrap();
    copy(&mut thumbnail_response, &mut file).unwrap();
    println!("Image fetched and saved to {:?}", path);
}

lib.rs:

WireWave

Use the Wave API to fetch music by search query and retrieve thumbnails.

Dependencies

~7–18MB
~234K SLoC