diff options
author | lolcat <will@lolcat.ca> | 2024-04-21 19:31:56 -0400 |
---|---|---|
committer | lolcat <will@lolcat.ca> | 2024-04-21 19:31:56 -0400 |
commit | 130358a9e0504a55cf3f86b2d7035feb7f4e84de (patch) | |
tree | 81f59790f7ead0b393a0e0b25caa082216245fcd /api/v1 | |
parent | 9e18327df69542e07fad2ef471a3ebdbe9b08ae8 (diff) |
v8
Diffstat (limited to 'api/v1')
-rw-r--r-- | api/v1/ac.php | 22 |
1 files changed, 11 insertions, 11 deletions
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); |