From 130358a9e0504a55cf3f86b2d7035feb7f4e84de Mon Sep 17 00:00:00 2001 From: lolcat Date: Sun, 21 Apr 2024 19:31:56 -0400 Subject: v8 --- api/v1/ac.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'api/v1') diff --git a/api/v1/ac.php b/api/v1/ac.php index b1ec7dd..9d9f534 100644 --- a/api/v1/ac.php +++ b/api/v1/ac.php @@ -18,7 +18,7 @@ class autocomplete{ "yep" => "https://api.yep.com/ac/?query={searchTerms}", "marginalia" => "https://search.marginalia.nu/suggest/?partial={searchTerms}", "yt" => "https://suggestqueries-clients6.youtube.com/complete/search?client=youtube&q={searchTerms}", - "sc" => "https://api-v2.soundcloud.com/search/queries?q={searchTerms}&client_id=" . config::SC_CLIENT_TOKEN . "&limit=10&offset=0&linked_partitioning=1&app_version=1693487844&app_locale=en" + "sc" => "" ]; /* @@ -39,14 +39,6 @@ class autocomplete{ $this->do404("Search(s) exceeds the 500 char length"); } - if( - isset($_GET["scraper"]) && - is_string($_GET["scraper"]) === false - ){ - - $_GET["scraper"] = "brave"; // default option - } - /* Get $scraper */ @@ -77,7 +69,6 @@ class autocomplete{ } // return results - switch($scraper){ case "google": @@ -115,7 +106,16 @@ class autocomplete{ case "sc": // soundcloud - $js = $this->get($this->scrapers[$scraper], $_GET["s"]); + chdir("../../"); + include "scraper/sc.php"; + $sc = new sc(); + + $token = $sc->get_token("raw_ip::::"); + + $js = $this->get( + "https://api-v2.soundcloud.com/search/queries?q={searchTerms}&client_id=" . $token . "&limit=10&offset=0&linked_partitioning=1&app_version=1693487844&app_locale=en", + $_GET["s"] + ); $js = json_decode($js, true); -- cgit v1.2.3