Merge branch 'master' of https://gitea.awain.net/alterwain/soundcloud_api
This commit is contained in:
commit
87614c2a10
@ -26,7 +26,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
async fn get_likes(user_id: u64, client_id: String, app_version: String) -> Result<Option<String>, Box<dyn Error>> {
|
pub async fn get_likes(user_id: u64, client_id: String, app_version: String) -> Result<Option<String>, Box<dyn Error>> {
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
|
|
||||||
let resp = client.get(format!("https://{}/users/{}/likes?client_id={}&limit=10&offset=0&linked_partitioning=1&app_version={}&app_locale=en", SOUNDCLOUD_API_DOMAIN, user_id, client_id, app_version) )
|
let resp = client.get(format!("https://{}/users/{}/likes?client_id={}&limit=10&offset=0&linked_partitioning=1&app_version={}&app_locale=en", SOUNDCLOUD_API_DOMAIN, user_id, client_id, app_version) )
|
||||||
@ -39,7 +39,7 @@ async fn get_likes(user_id: u64, client_id: String, app_version: String) -> Resu
|
|||||||
Ok(Some(resp))
|
Ok(Some(resp))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn get_playlists(user_id: u64, client_id: String, app_version: String) -> Result<CloudPlaylists, Box<dyn Error>> {
|
pub async fn get_playlists(user_id: u64, client_id: String, app_version: String) -> Result<CloudPlaylists, Box<dyn Error>> {
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
|
|
||||||
let resp = client.get(format!("https://{}/users/{}/playlists_without_albums?client_id={}&limit=10&offset=0&linked_partitioning=1&app_version={}&app_locale=en", SOUNDCLOUD_API_DOMAIN, user_id, client_id, app_version))
|
let resp = client.get(format!("https://{}/users/{}/playlists_without_albums?client_id={}&limit=10&offset=0&linked_partitioning=1&app_version={}&app_locale=en", SOUNDCLOUD_API_DOMAIN, user_id, client_id, app_version))
|
||||||
@ -54,7 +54,7 @@ async fn get_playlists(user_id: u64, client_id: String, app_version: String) ->
|
|||||||
Ok(playlists)
|
Ok(playlists)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn get_app() -> Result<Option<String>, Box<dyn Error>> {
|
pub async fn get_app() -> Result<Option<String>, Box<dyn Error>> {
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
|
|
||||||
let resp = client.get(format!("{}/versions.json", SOUNDCLOUD_DOMAIN))
|
let resp = client.get(format!("{}/versions.json", SOUNDCLOUD_DOMAIN))
|
||||||
@ -79,7 +79,7 @@ async fn get_app() -> Result<Option<String>, Box<dyn Error>> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn get_client_id() -> Result<Option<String>, Box<dyn Error>> {
|
pub async fn get_client_id() -> Result<Option<String>, Box<dyn Error>> {
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
|
|
||||||
let resp = client.get(format!("{}/soundcloud", SOUNDCLOUD_DOMAIN))
|
let resp = client.get(format!("{}/soundcloud", SOUNDCLOUD_DOMAIN))
|
Loading…
x
Reference in New Issue
Block a user