From 9e65ca0a98e4841268d6ce1f63643ab607c79d12 Mon Sep 17 00:00:00 2001 From: Jacherr Date: Sun, 28 Jul 2024 20:50:11 +0100 Subject: [PATCH] do not cache web downloaders which are ratelimited by youtube --- assyst-core/src/rest/web_media_download.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/assyst-core/src/rest/web_media_download.rs b/assyst-core/src/rest/web_media_download.rs index 6fcd144..37a525b 100644 --- a/assyst-core/src/rest/web_media_download.rs +++ b/assyst-core/src/rest/web_media_download.rs @@ -61,6 +61,8 @@ pub struct YouTubePlaylistEntry { #[derive(Deserialize)] pub struct WebDownloadResult { pub url: String, + #[serde(rename = "status")] + pub _status: String, } #[derive(Deserialize)] @@ -110,8 +112,8 @@ async fn test_route(assyst: ThreadSafeAssyst, url: &str) -> bool { } /// Always returns the main API instance (api.cobalt.tools) at the minimum. \ -/// Other URLs must be a score of 100 (i.e., all sites supported) and must have a \ -/// domain over https. +/// Other URLs must be a score of at least 90 (i.e., most sites supported), must support YouTube, +/// and must have a domain over https. pub async fn get_web_download_api_urls(assyst: ThreadSafeAssyst) -> anyhow::Result> { let res = assyst .reqwest_client @@ -266,9 +268,13 @@ pub async fn download_web_media(assyst: ThreadSafeAssyst, url: &str, opts: WebDo if let Ok(s) = String::from_utf8(media.clone()) && s.starts_with("