{"record":{"id":"f3c5eee4bba2e4b3","repo":"tonhowtf/omniget","slug":"n-o-consegui-ler-a-lista-sound","errorCode":null,"errorMessage":"não consegui ler a lista {}: {}","messagePattern":"não consegui ler a lista (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/tiktok/sound.rs","lineNumber":306,"sourceCode":"pub async fn run(opts: &Options, progress: ProgressFn) -> Result<SoundResult> {\n    if opts.dest.trim().is_empty() {\n        return Err(anyhow!(\"escolha a pasta de destino\"));\n    }\n    let dest = PathBuf::from(&opts.dest);\n    std::fs::create_dir_all(&dest)?;\n\n    let session = TempCookies::new(opts.session_netscape.as_deref());\n    let used_session = session.is_some();\n    let cookies: Option<PathBuf> = opts\n        .cookies\n        .as_deref()\n        .filter(|c| !c.trim().is_empty())\n        .map(PathBuf::from)\n        .or_else(|| session.path().map(|p| p.to_path_buf()));\n\n    let list_text = match opts.list_file.as_deref().filter(|p| !p.trim().is_empty()) {\n        Some(path) => std::fs::read_to_string(path)\n            .map_err(|e| anyhow!(\"não consegui ler a lista {}: {}\", path, e))?,\n        None => String::new(),\n    };\n    let mut queue = expand_inputs(&opts.urls);\n    for url in expand_inputs(&list_text) {\n        if !queue.contains(&url) {\n            queue.push(url);\n        }\n    }\n    if queue.is_empty() {\n        return Err(anyhow!(\"nenhum link de vídeo do TikTok na entrada\"));\n    }\n\n    let audio_format = match opts.format.as_str() {\n        \"m4a\" => \"m4a\",\n        \"best\" => \"best\",\n        _ => \"mp3\",\n    };\n    let ffmpeg = crate::core::dependencies::find_tool(\"ffmpeg\").await;","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/tiktok/sound.rs#L288-L324","documentation":"When opts.list_file points to a file, sound::run reads it with std::fs::read_to_string; if that fails (missing file, permissions, invalid UTF-8) the IO error is wrapped in this message. The list file is an optional way to feed extra URLs, so the library treats an unreadable explicit path as a hard error rather than silently ignoring it.","triggerScenarios":"opts.list_file is set to a path that does not exist, is a directory, lacks read permission, or contains invalid UTF-8; the path is set but non-empty so the Some branch executes.","commonSituations":"Typo in the list file path; file deleted or moved after being configured; relative path resolved from a different working directory; file saved in an encoding that is not valid UTF-8.","solutions":["Verify the list file exists and is readable at the exact path in opts.list_file","Convert the list file to UTF-8 encoding","Clear opts.list_file (empty/whitespace) if you do not actually want a list file, so the None branch is used"],"exampleFix":"// before\nlet opts = Options { list_file: Some(\"lists/som.txt\".into()), ..opts };\n// after\nlet path = \"lists/som.txt\";\nif !path.is_empty() {\n    std::fs::metadata(path).map_err(|e| anyhow!(\"lista ausente: {e}\"))?;\n}\nlet opts = Options { list_file: Some(path.into()), ..opts };","handlingStrategy":"validation","validationCode":"if let Some(path) = opts.list_file.as_deref().filter(|p| !p.trim().is_empty()) {\n    std::fs::metadata(path).map_err(|e| anyhow!(\"lista '{}' ilegível: {}\", path, e))?;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Store list file paths as absolute paths","Check file existence and readability when the user selects it in the UI","Keep list files saved as UTF-8"],"tags":["io","file-read","rust"],"backgroundTag":"file-read-failed","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"}