soundcloud token expiry fix

This commit is contained in:
2025-12-13 19:41:47 -05:00
parent aa7c85b98a
commit 800cde93cf

View File

@@ -257,7 +257,7 @@ class sc{
} }
// token might've expired, get a new one and re-try search // token might've expired, get a new one and re-try search
$this->get_token($proxy); $token = $this->get_token($proxy, true);
return $this->music($get, true); return $this->music($get, true);
} }
@@ -422,11 +422,14 @@ class sc{
return $out; return $out;
} }
public function get_token($proxy){ public function get_token($proxy, $force_refresh = false){
$token = apcu_fetch("sc_token"); $token = apcu_fetch("sc_token");
if($token !== false){ if(
$token !== false &&
$force_refresh === false
){
return $token; return $token;
} }