#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

#13 in #retrieve

Download history 227/week @ 2024-07-18 170/week @ 2024-07-25 25/week @ 2024-08-01 2/week @ 2024-09-12 13/week @ 2024-09-19 13/week @ 2024-09-26 2/week @ 2024-10-03

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
~232K SLoC