diff --git a/src/infrastructure/repository/downloader.rs b/src/infrastructure/repository/downloader.rs index f3eb4c0..dba106c 100644 --- a/src/infrastructure/repository/downloader.rs +++ b/src/infrastructure/repository/downloader.rs @@ -872,6 +872,7 @@ pub(crate) async fn fetch_snapsave(url: &str) -> Result Result { if let Some(download_url) = data.get("download_link").and_then(|v| v.as_str()) { let size_bytes = data.get("file_size").and_then(|v| v.as_u64()).unwrap_or(0); - result.media.push(MediaItem { - url: download_url.to_string(), - quality: None, - file_type: Some(MediaType::File), - extension: None, - thumbnail: None, - file_size: Some(format_filesize(size_bytes)), - size_bytes: Some(size_bytes), - frame_width: None, - frame_height: None, - note: None, - }); - // A second entry pointing to the cookie-authenticated proxy — this one - // is what actually downloads when the user clicks it. + // PRIMARY = the cookie-authenticated public proxy. The raw terabox + // dlink is only a secondary entry — it 403s without cookies, so it + // must NOT be the first link users see. result.media.push(MediaItem { url: proxy_dl.clone(), quality: None, @@ -3502,10 +3492,19 @@ pub async fn fetch_terabox(url: &str) -> Result { size_bytes: Some(size_bytes), frame_width: None, frame_height: None, - note: Some( - "Direct download via cookie-authenticated proxy (works without TeraBox cookies)" - .into(), - ), + note: Some("Direct download via cookie-authenticated proxy (works).".into()), + }); + result.media.push(MediaItem { + url: download_url.to_string(), + quality: None, + file_type: Some(MediaType::File), + extension: None, + thumbnail: None, + file_size: Some(format_filesize(size_bytes)), + size_bytes: Some(size_bytes), + frame_width: None, + frame_height: None, + note: Some("Raw CDN link (may require a TeraBox session cookie).".into()), }); // Directory: add child file links