From 41a78013f101c22977edf58ee68b0aba16b5201f Mon Sep 17 00:00:00 2001 From: alterwain Date: Tue, 4 Feb 2025 18:06:31 +0300 Subject: [PATCH] modified: .gitignore modified: src/main.rs --- .gitignore | 1 + src/main.rs | 52 ++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index ea8c4bf..0d20b7e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +output.json \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 8cccd4b..f2d9dcc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,17 +1,17 @@ -use std::{collections::HashMap, error::Error}; +use std::{collections::HashMap, error::Error, fmt::format, fs::File, io::Write}; use regex::Regex; +use reqwest::header::{HOST, ORIGIN, REFERER, USER_AGENT}; +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"] */ - -// https://soundcloud.com/soundcloud regex: "