Updated the ytmusic cookies situation

This commit is contained in:
Connor Johnstone
2026-03-20 13:38:49 -04:00
parent c8e78606b1
commit fed86c9e85
10 changed files with 722 additions and 15 deletions

View File

@@ -242,3 +242,25 @@ pub async fn save_config(config: &AppConfig) -> Result<AppConfig, ApiError> {
}
resp.json().await.map_err(|e| ApiError(e.to_string()))
}
// --- YouTube Auth ---
pub async fn get_ytauth_status() -> Result<YtAuthStatus, ApiError> {
get_json(&format!("{BASE}/ytauth/status")).await
}
pub async fn ytauth_login_start() -> Result<serde_json::Value, ApiError> {
post_empty(&format!("{BASE}/ytauth/login-start")).await
}
pub async fn ytauth_login_stop() -> Result<serde_json::Value, ApiError> {
post_empty(&format!("{BASE}/ytauth/login-stop")).await
}
pub async fn ytauth_refresh() -> Result<serde_json::Value, ApiError> {
post_empty(&format!("{BASE}/ytauth/refresh")).await
}
pub async fn ytauth_clear_cookies() -> Result<(), ApiError> {
delete(&format!("{BASE}/ytauth/cookies")).await
}