{"record":{"id":"ab6f42e19bba9e77","repo":"tonhowtf/omniget","slug":"gallery-dl-falhou","errorCode":null,"errorMessage":"gallery-dl falhou: {}","messagePattern":"gallery-dl falhou: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/gallery.rs","lineNumber":97,"sourceCode":"            }\n        }\n        files\n    });\n    let err_task = tokio::spawn(async move {\n        let mut tail = String::new();\n        if let Some(e) = stderr {\n            let mut lines = BufReader::new(e).lines();\n            while let Ok(Some(line)) = lines.next_line().await {\n                tail = line;\n            }\n        }\n        tail\n    });\n    let status = child.wait().await?;\n    let files = out_task.await.unwrap_or_default();\n    let tail = err_task.await.unwrap_or_default();\n    if !status.success() && files.is_empty() {\n        return Err(anyhow!(\"gallery-dl falhou: {}\", tail));\n    }\n    super::report(\n        &progress,\n        &id,\n        \"done\",\n        files.len() as u64,\n        Some(files.len() as u64),\n        None,\n    );\n    Ok(GalleryResult {\n        files,\n        dest: dest.to_string(),\n        log_tail: tail,\n    })\n}\n","sourceCodeStart":79,"sourceCodeEnd":113,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/gallery.rs#L79-L113","documentation":"After the gallery-dl child exits, download() inspects its status: a non-zero exit with zero files downloaded is converted into this error carrying the collected stderr tail. If some files were downloaded, the failure is tolerated.","triggerScenarios":"gallery-dl exits non-zero and produced no files — bad URL, unsupported site, HTTP 403/429 from the host, expired cookies, or no network.","commonSituations":"Rate limiting or login-required galleries (missing/expired cookies file); site gallery-dl no longer supports (extractor drift after site changes); typo in the gallery URL.","solutions":["Read the stderr tail in the error — it names the extractor/HTTP failure","Pass a valid cookies_file for sites requiring login; refresh expired cookies","Update gallery-dl to the latest version (site extractors change frequently) and retry"],"exampleFix":"// before\nlet r = gallery::download(url, dest, None, progress).await?;\n// after (login-required site)\nlet r = gallery::download(url, dest, Some(\"cookies.txt\"), progress).await?;","handlingStrategy":"try-catch","validationCode":"// preflight: is the URL reachable and does it need cookies?\nlet needs_cookies = url.contains(\"twitter\") || url.contains(\"pixiv\"); // example\nif needs_cookies && cookies_file.is_none() {\n    return Err(anyhow!(\"este site exige cookies de login\"));\n}","typeGuard":null,"tryCatchPattern":"match gallery::download(url, dest, cookies, progress).await {\n    Err(e) if e.to_string().contains(\"gallery-dl falhou\") => {\n        // inspect tail for 403/429 and advise user\n        Err(anyhow!(\"download da galeria falhou — verifique login/limite: {e}\"))\n    }\n    other => other,\n}","preventionTips":["Keep gallery-dl updated — extractors break when sites change","Provide fresh cookies for login-required sites","Respect rate limits; add delays between gallery downloads"],"tags":["gallery-dl","subprocess","download-failed"],"backgroundTag":"api-error-response","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}