new file: .gitignore

new file:   Cargo.lock
	new file:   Cargo.toml
	new file:   src/main.rs
This commit is contained in:
Michael Wain 2024-12-19 20:38:52 +03:00
commit a4f37099b1
4 changed files with 1551 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

1520
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

15
Cargo.toml Normal file
View File

@ -0,0 +1,15 @@
[package]
name = "soundcloud"
version = "0.1.0"
edition = "2021"
description = "A small rust crate for fetching data from soundcloud without developer account"
authors = ["alterwain"]
keywords = ["api", "network", "audio", "music"]
categories = ["network-programming", "asynchronous", "api", "music", "audio"]
[lib]
crate-type = ["staticlib", "cdylib", "lib"]
[dependencies]
reqwest = { version = "0.12", features = ["json"] }
tokio = { version = "1", features = ["full"] }

15
src/main.rs Normal file
View File

@ -0,0 +1,15 @@
use std::collections::HashMap;
// https://soundcloud.com/versions.json
// likes: https://api-v2.soundcloud.com/users/774639751/likes?client_id=zFEmsF1cEZZQ92nRRXKOg7e6ibFR1L7c&limit=10&offset=0&linked_partitioning=1&app_version=1734537250&app_locale=en
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let resp = reqwest::get("https://api-v2.soundcloud.com/users/774639751/playlists_without_albums?client_id=zFEmsF1cEZZQ92nRRXKOg7e6ibFR1L7c&limit=10&offset=0&linked_partitioning=1&app_version=1734537250&app_locale=en")
.await?
.json::<HashMap<String, String>>()
.await?;
println!("{resp:#?}");
Ok(())
}