{"record":{"id":"b9306b204e5f84ea","repo":"tonhowtf/omniget","slug":"cole-um-link-do-slideshare-net","errorCode":null,"errorMessage":"cole um link do slideshare.net","messagePattern":"cole um link do slideshare\\.net","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/slides.rs","lineNumber":88,"sourceCode":"        .args([\"-y\", \"-hide_banner\", \"-loglevel\", \"error\", \"-i\"])\n        .arg(&input)\n        .args([\"-q:v\", \"2\"])\n        .arg(&output)\n        .output()\n        .await?;\n    if !o.status.success() {\n        return Err(anyhow!(\"ffmpeg nao converteu a imagem {}\", idx));\n    }\n    Ok(tokio::fs::read(&output).await?)\n}\n\npub async fn download(\n    url: &str,\n    dest_dir: &str,\n    progress: super::ProgressFn,\n) -> anyhow::Result<SlidesResult> {\n    if !url.contains(\"slideshare.net\") {\n        return Err(anyhow!(\"cole um link do slideshare.net\"));\n    }\n    let client = super::client()?;\n    let html = client\n        .get(url)\n        .send()\n        .await?\n        .error_for_status()?\n        .text()\n        .await?;\n    let urls = parse_slide_urls(&html);\n    if urls.is_empty() {\n        return Err(anyhow!(\"nao encontrei slides nessa pagina (o SlideShare pode ter mudado o HTML ou o deck e privado)\"));\n    }\n    let title = og_title(&html).unwrap_or_else(|| \"slideshare\".to_string());\n    let work = super::temp_dir().join(format!(\"slides-{}\", uuid::Uuid::new_v4()));\n    std::fs::create_dir_all(&work)?;\n    let mut images = Vec::with_capacity(urls.len());\n    let id = format!(\"slides:{}\", url);","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/slides.rs#L70-L106","documentation":"Guard clause in `slides::download` that rejects any URL not containing the substring \"slideshare.net\". The tool only knows how to scrape SlideShare decks, so a non-SlideShare link is refused before any network request is made. It is a user-input validation error, not a runtime failure.","triggerScenarios":"Calling `slides::download(url, dest_dir, progress)` with a URL whose string does not contain \"slideshare.net\" (e.g. a YouTube link, a slide-host.com link, or a typo like \"slideshare.com\").","commonSituations":"Pasting a link from another slide service; typos in the domain; mobile share-links (e.g. slideshare.app.goo.gl shorteners) that don't literally contain the domain; passing a slide ID instead of a URL.","solutions":["Pass a full URL that contains \"slideshare.net\" (e.g. https://www.slideshare.net/user/deck-title).","Resolve short-link redirects to the final slideshare.net URL before calling download.","If a different slide host must be supported, extend or add a dedicated downloader instead of reusing this function."],"exampleFix":"// before\nslides::download(\"https://slideshare.com/user/deck\", dest, progress).await?;\n// after\nslides::download(\"https://www.slideshare.net/user/deck\", dest, progress).await?;","handlingStrategy":"validation","validationCode":"if !url.contains(\"slideshare.net\") {\n    return Err(format!(\"not a slideshare link: {}\", url));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass the full final slideshare.net URL, not shorteners.","Resolve redirect links (t.co, goo.gl) before calling.","Normalize/trim pasted input first."],"tags":["validation","url","slideshare"],"backgroundTag":"invalid-url-format","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"}