Crates.io | musicou-kit |
lib.rs | musicou-kit |
version | 0.1.2 |
source | src |
created_at | 2023-07-20 21:47:56.359286 |
updated_at | 2023-08-30 07:45:35.722076 |
description | An unofficial API wrapper for music streaming sites like Youtube Music, Soundcloud and Bandcamp |
homepage | |
repository | |
max_upload_size | |
id | 921792 |
size | 93,340 |
Musicou-kit is an API wrapper for Youtube Music, SoundCloud and Bandcamp. It's fairly straight forward to use and easy to implement into other applications.
This crate is still experimental & WIP and will significantly change in the future. It has very messy code and some bugs and only support one(1) platform for now..
#[tokio::main]
async fn main() {
env_logger::init(); // logs stuff
// crating search with query and defining platform
let mut search = Search::new("the weeknd" structs::Platform::Youtube)
.fetch(structs::Page::Artist) // fetching a certain page
.await;
// fetching all data for first artist in search results
print!(" {:?}, ", search.unwrap().artists.unwrap()[0].fetch().await)
// Ok(Artist { id: "UClYV6hHlupm_S_ObS1W-DYw", name: "The Weeknd", platform: Youtube, thumbnails: [Thumbnail { url: ".....", width: 540, height: 225 }], background: [], incomplete: true, followers: 33000000 }
}
#[tokio::main]
async fn main() {
env_logger::init(); // logs stuff
let song = Song::from_id("diW6jXhLE0E").fetch().await;
println!("{:?}", song.unwrap());
// Song { id: "", title: "The Weeknd - Party Monster (Official Video)", length: 258, author: Artist { id: "", name: "", platform: Youtube, thumbnails: [], background: [], incomplete: true, followers: 0, private_field: "" }, thumbnails: [Thumbnail { url: "https://i.ytimg.com/.....", width: 400, height: 225 } ... ], view_count: 154341745, streams: Some([Stream { url: "https://rr3---....", bitrate: "130477", mime_type: "audio/mp4; codecs="mp4a.40.2" } ]), album: None, type_of: Youtube, incomplete: false}
}
Youtube scraping / extracting
Soundcloud scraping
Bandcamp scraping