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
201 downloads per month
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