modified: Cargo.lock

modified:   Cargo.toml
	modified:   src/lib.rs
	modified:   src/sobjects.rs
This commit is contained in:
Michael Wain 2025-02-13 03:10:14 +03:00
parent 22f02cfa43
commit a72d62cb36
4 changed files with 13 additions and 12 deletions

4
Cargo.lock generated
View File

@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 4
[[package]] [[package]]
name = "addr2line" name = "addr2line"
@ -1036,7 +1036,7 @@ dependencies = [
[[package]] [[package]]
name = "soundcloud" name = "soundcloud"
version = "0.1.4" version = "0.1.5"
dependencies = [ dependencies = [
"hyper-util", "hyper-util",
"regex", "regex",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "soundcloud" name = "soundcloud"
version = "0.1.4" version = "0.1.5"
edition = "2021" edition = "2021"
description = "A small rust crate for fetching data from soundcloud without developer account" description = "A small rust crate for fetching data from soundcloud without developer account"
authors = ["alterwain"] authors = ["alterwain"]

View File

@ -1,7 +1,7 @@
use std::{collections::HashMap, error::Error, fmt::format, fs::File, io::Write}; use std::error::Error;
use regex::Regex; use regex::Regex;
use reqwest::header::{HOST, ORIGIN, REFERER, USER_AGENT}; use reqwest::header::USER_AGENT;
use sobjects::CloudPlaylists; use sobjects::CloudPlaylists;
pub mod sobjects; pub mod sobjects;

View File

@ -1,6 +1,6 @@
#[derive(Debug, serde::Deserialize, Clone)] #[derive(Debug, serde::Deserialize, Clone)]
pub struct CloudPlaylists { pub struct CloudPlaylists {
pub collection: Vec<CloudPlaylist> pub collection: Vec<CloudPlaylist>,
} }
#[derive(Debug, serde::Deserialize, Clone)] #[derive(Debug, serde::Deserialize, Clone)]
@ -13,7 +13,7 @@ pub struct CloudPlaylist {
pub created_at: String, pub created_at: String,
pub title: String, pub title: String,
pub track_count: u32, pub track_count: u32,
pub tracks: Vec<CloudTrack> pub tracks: Vec<CloudTrack>,
} }
#[derive(Debug, serde::Deserialize, Clone)] #[derive(Debug, serde::Deserialize, Clone)]
@ -27,12 +27,13 @@ pub struct CloudTrack {
pub permalink_url: Option<String>, pub permalink_url: Option<String>,
pub title: Option<String>, pub title: Option<String>,
pub uri: Option<String>, pub uri: Option<String>,
pub media: Option<CloudTranscodings> pub artist: Option<String>,
pub media: Option<CloudTranscodings>,
} }
#[derive(Debug, serde::Deserialize, Clone)] #[derive(Debug, serde::Deserialize, Clone)]
pub struct CloudTranscodings { pub struct CloudTranscodings {
pub transcodings: Vec<CloudTranscoding> pub transcodings: Vec<CloudTranscoding>,
} }
#[derive(Debug, serde::Deserialize, Clone)] #[derive(Debug, serde::Deserialize, Clone)]
@ -40,5 +41,5 @@ pub struct CloudTranscoding {
pub duration: u32, pub duration: u32,
pub preset: String, pub preset: String,
pub quality: String, pub quality: String,
pub url: String pub url: String,
} }