From a72d62cb364aa4376abf1ada838a7b44220d0d6a Mon Sep 17 00:00:00 2001 From: "alterwain@protonmail.com" Date: Thu, 13 Feb 2025 03:10:14 +0300 Subject: [PATCH] modified: Cargo.lock modified: Cargo.toml modified: src/lib.rs modified: src/sobjects.rs --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/lib.rs | 4 ++-- src/sobjects.rs | 15 ++++++++------- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ecce0ff..ec89165 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -1036,7 +1036,7 @@ dependencies = [ [[package]] name = "soundcloud" -version = "0.1.4" +version = "0.1.5" dependencies = [ "hyper-util", "regex", diff --git a/Cargo.toml b/Cargo.toml index f5144e6..a3012c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "soundcloud" -version = "0.1.4" +version = "0.1.5" edition = "2021" description = "A small rust crate for fetching data from soundcloud without developer account" authors = ["alterwain"] diff --git a/src/lib.rs b/src/lib.rs index ab7b4bc..368e0c7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,7 @@ -use std::{collections::HashMap, error::Error, fmt::format, fs::File, io::Write}; +use std::error::Error; use regex::Regex; -use reqwest::header::{HOST, ORIGIN, REFERER, USER_AGENT}; +use reqwest::header::USER_AGENT; use sobjects::CloudPlaylists; pub mod sobjects; diff --git a/src/sobjects.rs b/src/sobjects.rs index dd3a76f..754f34c 100644 --- a/src/sobjects.rs +++ b/src/sobjects.rs @@ -1,6 +1,6 @@ #[derive(Debug, serde::Deserialize, Clone)] pub struct CloudPlaylists { - pub collection: Vec + pub collection: Vec, } #[derive(Debug, serde::Deserialize, Clone)] @@ -13,26 +13,27 @@ pub struct CloudPlaylist { pub created_at: String, pub title: String, pub track_count: u32, - pub tracks: Vec + pub tracks: Vec, } #[derive(Debug, serde::Deserialize, Clone)] pub struct CloudTrack { pub artwork_url: Option, pub created_at: Option, - pub description: Option, + pub description: Option, pub duration: Option, pub genre: Option, pub id: u64, pub permalink_url: Option, pub title: Option, pub uri: Option, - pub media: Option + pub artist: Option, + pub media: Option, } #[derive(Debug, serde::Deserialize, Clone)] pub struct CloudTranscodings { - pub transcodings: Vec + pub transcodings: Vec, } #[derive(Debug, serde::Deserialize, Clone)] @@ -40,5 +41,5 @@ pub struct CloudTranscoding { pub duration: u32, pub preset: String, pub quality: String, - pub url: String -} \ No newline at end of file + pub url: String, +}