{"record":{"id":"ca3412ca3300c8e2","repo":"tonhowtf/omniget","slug":"esse-v-deo-n-o-tem-legenda-ligue-o-whisper-para-transcrever","errorCode":null,"errorMessage":"esse vídeo não tem legenda; ligue o Whisper para transcrever","messagePattern":"esse vídeo não tem legenda; ligue o Whisper para transcrever","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/yt_notes.rs","lineNumber":495,"sourceCode":"        super::report(&progress, ID, \"progress\", 2, Some(4), None);\n        match fetch_subtitles(&opts).await {\n            Ok(Some(text)) => {\n                cues = super::subtitle::parse(&text)?;\n                source = \"legenda-youtube\".to_string();\n            }\n            Ok(None) | Err(_) if opts.allow_whisper => {\n                super::report(&progress, ID, \"progress\", 3, Some(4), None);\n                let audio = download_audio(&opts).await?;\n                let r = transcribe(&audio, &opts, progress.clone()).await?;\n                let _ = std::fs::remove_file(&audio);\n                if meta.language.is_empty() {\n                    meta.language = r.language.clone();\n                }\n                cues = r.cues;\n                source = \"whisper\".to_string();\n            }\n            Ok(None) => {\n                return Err(anyhow!(\n                    \"esse vídeo não tem legenda; ligue o Whisper para transcrever\"\n                ))\n            }\n            Err(e) => return Err(e),\n        }\n    } else if !opts.media_path.trim().is_empty() {\n        let path = std::path::PathBuf::from(opts.media_path.trim());\n        let r = transcribe(&path, &opts, progress.clone()).await?;\n        if meta.title.is_empty() {\n            meta.title = path\n                .file_stem()\n                .map(|s| s.to_string_lossy().to_string())\n                .unwrap_or_default();\n        }\n        meta.language = r.language.clone();\n        meta.duration_seconds = r.seconds;\n        cues = r.cues;\n        source = \"whisper\".to_string();","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/yt_notes.rs#L477-L513","documentation":"When no local subtitle or media path is given, the tool tries to fetch subtitles from the source video; a None result means the video has no available captions. The error tells the user to enable Whisper transcription as the fallback path for generating cues.","triggerScenarios":"`run` reaches the subtitle-fetch branch, `fetch` returns Ok(None) — the platform reports no subtitle tracks for this video (or none in the requested language).","commonSituations":"Video uploaded without captions; captions exist but not in the requested language; platform blocks anonymous caption access; URL points to a non-video page; region/age restrictions hiding tracks.","solutions":["Enable/configure Whisper transcription so the tool can generate cues from audio","Provide a local subtitle file via opts.subtitle_path instead","Provide the downloaded media via opts.media_path and run Whisper locally","Check the video URL actually has captions visible on its page"],"exampleFix":"// before\nlet opts = Options { url: url.into(), ..Default::default() }; // no subtitles available\n// after\nlet mut opts = Options { url: url.into(), ..Default::default() };\nopts.whisper_enabled = true; // transcribe when captions are absent\nrun(opts, progress).await?;","handlingStrategy":"fallback","validationCode":"// check captions availability before running\nlet has_subs = fetch_subtitle_tracks(&opts.url).await.map(|t| !t.is_empty()).unwrap_or(false);","typeGuard":null,"tryCatchPattern":"match run(opts, progress).await {\n    Err(e) if e.to_string().contains(\"esse vídeo não tem legenda\") => {\n        // fall back to Whisper transcription or supply a local subtitle\n    }\n    other => other?,\n}","preventionTips":["Enable Whisper as an automatic fallback","Check caption availability on the video page beforehand","Provide media_path/local subtitles for caption-less videos"],"tags":["rust","subtitles","whisper","fallback"],"backgroundTag":"resource-not-found","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}