{"record":{"id":"375aec5b2344f884","repo":"tonhowtf/omniget","slug":"o-gallery-dl-n-o-conseguiu-ler-essa-p-gina","errorCode":null,"errorMessage":"o gallery-dl não conseguiu ler essa página: {}","messagePattern":"o gallery-dl não conseguiu ler essa página: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/tumblr/gdl.rs","lineNumber":305,"sourceCode":"    super::super::report(progress, id, \"started\", 0, None, None);\n    let mut text = String::new();\n    let mut buf = vec![0u8; 64 * 1024];\n    let mut last = std::time::Instant::now();\n    loop {\n        let n = stdout.read(&mut buf).await?;\n        if n == 0 {\n            break;\n        }\n        text.push_str(&String::from_utf8_lossy(&buf[..n]));\n        if last.elapsed() > std::time::Duration::from_millis(300) {\n            super::super::report(progress, id, \"progress\", text.len() as u64, None, None);\n            last = std::time::Instant::now();\n        }\n    }\n    let status = child.wait().await?;\n    let tail = err_task.await.unwrap_or_default();\n    if !status.success() && text.trim().is_empty() {\n        return Err(anyhow!(\n            \"o gallery-dl não conseguiu ler essa página: {}\",\n            if tail.is_empty() {\n                \"sem detalhe\".to_string()\n            } else {\n                tail\n            }\n        ));\n    }\n    parse_dump(&text)\n}\n\n#[derive(Debug, Clone, Default)]\npub struct Downloaded {\n    pub files: Vec<String>,\n    pub log_tail: String,\n}\n\n/// `gallery-dl -d <dest> --write-metadata <url>`: baixa a mídia e grava o","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/tumblr/gdl.rs#L287-L323","documentation":"dump() waits for gallery-dl to finish; if the process exited non-success AND nothing useful was printed on stdout (text.trim().is_empty()), it throws this error including the collected stderr tail, or 'sem detalhe' when stderr was empty. If stdout has content, the dump is still considered usable despite the failure exit code.","triggerScenarios":"gallery-dl exits with a non-zero status (network failure, 403/auth error, unsupported URL, rate limit) and produced no JSON on stdout; the stderr tail carries the underlying reason.","commonSituations":"Private or deleted Tumblr page; expired cookies passed to dump(); network outage or DNS failure; gallery-dl extractor broken for a changed page layout; rate limiting by the target site.","solutions":["Inspect the stderr detail appended in the error message for the root cause","Refresh the cookies passed as the cookies parameter if the page requires auth","Retry if the stderr suggests a transient network/rate-limit issue","Update gallery-dl if the extractor fails against a changed site layout"],"exampleFix":"// before\nlet dump = gdl::dump(&url, Some(&stale_cookies), limit).await?;\n// after\nmatch gdl::dump(&url, Some(&stale_cookies), limit).await {\n    Ok(d) => d,\n    Err(e) if e.to_string().contains(\"não conseguiu ler essa página\") => {\n        refresh_cookies(&mut session)?;\n        gdl::dump(&url, Some(&session.cookie_path()), limit).await?\n    }\n    Err(e) => return Err(e),\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match gdl::dump(&url, cookies, limit).await {\n    Ok(d) => d,\n    Err(e) if e.to_string().contains(\"não conseguiu ler essa página\") => {\n        let detail = e.to_string();\n        if detail.contains(\"403\") || detail.contains(\"login\") { refresh_cookies()?; }\n        else if detail.contains(\"timeout\") || detail.contains(\"temporário\") { retry_with_backoff(3, || gdl::dump(&url, cookies, limit)).await?; }\n        else { return Err(e); }\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep cookies fresh and pass them explicitly","Implement backoff retry for transient network failures","Update gallery-dl when extractors break on site changes","Respect rate limits to avoid blocking"],"tags":["network","gallery-dl","external-process","http-error"],"backgroundTag":"http-error-response","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}