wirewave

Crates.iowirewave
lib.rswirewave
version0.1.4
sourcesrc
created_at2024-07-22 21:21:25.347988
updated_at2024-07-30 17:34:33.373767
descriptionUse WireWay's Wave API to fetch music by search query
homepage
repositoryhttps://github.com/waradu/wirewave
max_upload_size
id1312054
size8,169
Waradu (Waradu)

documentation

README

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);
}
Commit count: 0

cargo fmt