modified: Cargo.lock
modified: Cargo.toml modified: src/main.rs modified: src/sobjects.rs
This commit is contained in:
parent
17e3f8881e
commit
0d3769dcc3
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1036,7 +1036,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "soundcloud"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"hyper-util",
|
||||
"regex",
|
||||
|
@ -1,12 +1,15 @@
|
||||
[package]
|
||||
name = "soundcloud"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
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.12", features = ["json"] }
|
||||
tokio = { version = "1.43.0", features = ["full"] }
|
||||
|
10
src/main.rs
10
src/main.rs
@ -4,22 +4,18 @@ use regex::Regex;
|
||||
use reqwest::header::{HOST, ORIGIN, REFERER, USER_AGENT};
|
||||
use sobjects::CloudPlaylists;
|
||||
|
||||
mod sobjects;
|
||||
pub mod sobjects;
|
||||
|
||||
const CHROME_USER_AGENT: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36";
|
||||
const SOUNDCLOUD_API_DOMAIN: &str = "api-v2.soundcloud.com";
|
||||
const SOUNDCLOUD_DOMAIN: &str = "https://soundcloud.com";
|
||||
/*
|
||||
|
||||
[lib]
|
||||
crate-type = ["staticlib", "cdylib", "lib"]
|
||||
*/
|
||||
// version: 1738322252
|
||||
// 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
|
||||
|
||||
// playlists: 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
|
||||
|
||||
#[tokio::main]
|
||||
/*#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let app_version = get_app().await.unwrap().unwrap();
|
||||
let client_id = get_client_id().await.unwrap().unwrap();
|
||||
@ -28,7 +24,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
println!("Playlists: {:#?}", get_playlists(user_id, client_id, app_version).await.unwrap());
|
||||
Ok(())
|
||||
}
|
||||
}*/
|
||||
|
||||
async fn get_likes(user_id: u64, client_id: String, app_version: String) -> Result<Option<String>, Box<dyn Error>> {
|
||||
let client = reqwest::Client::new();
|
||||
|
@ -1,9 +1,9 @@
|
||||
#[derive(Debug, serde::Deserialize)]
|
||||
#[derive(Debug, serde::Deserialize, Clone)]
|
||||
pub struct CloudPlaylists {
|
||||
pub collection: Vec<CloudPlaylist>
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize)]
|
||||
#[derive(Debug, serde::Deserialize, Clone)]
|
||||
pub struct CloudPlaylist {
|
||||
pub artwork_url: Option<String>,
|
||||
pub description: String,
|
||||
@ -16,7 +16,7 @@ pub struct CloudPlaylist {
|
||||
pub tracks: Vec<CloudTrack>
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize)]
|
||||
#[derive(Debug, serde::Deserialize, Clone)]
|
||||
pub struct CloudTrack {
|
||||
pub artwork_url: Option<String>,
|
||||
pub created_at: Option<String>,
|
||||
@ -30,12 +30,12 @@ pub struct CloudTrack {
|
||||
pub media: Option<CloudTranscodings>
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize)]
|
||||
#[derive(Debug, serde::Deserialize, Clone)]
|
||||
pub struct CloudTranscodings {
|
||||
pub transcodings: Vec<CloudTranscoding>
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize)]
|
||||
#[derive(Debug, serde::Deserialize, Clone)]
|
||||
pub struct CloudTranscoding {
|
||||
pub duration: u32,
|
||||
pub preset: String,
|
||||
|
Loading…
x
Reference in New Issue
Block a user