{"record":{"id":"b42c0fdf2db9a235","repo":"tonhowtf/omniget","slug":"nenhum-link-do-tiktok-na-entrada-cole-as-urls-escolha-um-txt","errorCode":null,"errorMessage":"nenhum link do TikTok na entrada (cole as URLs, escolha um .txt ou informe um perfil)","messagePattern":"nenhum link do TikTok na entrada \\(cole as URLs, escolha um \\.txt ou informe um perfil\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/tiktok/download.rs","lineNumber":179,"sourceCode":"        report(\n            &progress,\n            ID,\n            \"progress\",\n            0,\n            None,\n            Some(format!(\"lendo {}\", profile)),\n        );\n        for url in expand_profile(profile, opts.limit, cookies.as_deref()).await? {\n            if !queue.contains(&url) {\n                queue.push(url);\n            }\n        }\n    }\n    if opts.limit > 0 && queue.len() > opts.limit as usize {\n        queue.truncate(opts.limit as usize);\n    }\n    if queue.is_empty() {\n        return Err(anyhow!(\n            \"nenhum link do TikTok na entrada (cole as URLs, escolha um .txt ou informe um perfil)\"\n        ));\n    }\n\n    let selector = format_selector(opts.watermark, &opts.quality);\n    let ffmpeg = crate::core::dependencies::find_tool(\"ffmpeg\").await;\n    let pacer = Pacer::new(opts.delay_ms);\n    let total = queue.len() as u64;\n    let mut items: Vec<ItemResult> = Vec::with_capacity(queue.len());\n\n    for (i, url) in queue.iter().enumerate() {\n        let target = parse_target(url);\n        let (author, id) = match &target {\n            Some(Target::Video { user, id }) => (user.clone().unwrap_or_default(), id.clone()),\n            _ => (String::new(), String::new()),\n        };\n        report(\n            &progress,","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/tiktok/download.rs#L161-L197","documentation":"run() in tiktok/download.rs validates the resolved download queue before proceeding; when the queue is empty after parsing all input sources (pasted URLs, a .txt file, or a profile), it aborts with this anyhow error. It exists to fail fast with a clear message instead of silently downloading nothing. It is a guard against every input source yielding zero TikTok links.","triggerScenarios":"Calling run() when: the input string contains no recognizable TikTok URLs, opts.limit > 0 truncated an initially non-empty queue to zero (limit=0 edge interaction aside, a pre-empty queue), the profile/txt expansion produced no items, or a filter (watermark/quality) combined with an empty initial queue leaves nothing to download.","commonSituations":"User pastes text that includes no tiktok.com links (typos in the URL, links from another platform), passes a .txt file that is empty or only has comments/blank lines, or points at a profile that has no downloadable videos, so queue construction returns empty before the limit/truncate step.","solutions":["Verify the input actually contains valid tiktok.com URLs (https://www.tiktok.com/@user/video/...) and fix the input string or file.","If using a .txt file, confirm it is non-empty, UTF-8, and has one URL per line with no comment-only content.","If relying on a profile source, check the profile exists and has public videos; try pasting direct video URLs instead.","Check that opts.limit is not zeroing out the queue and that any pre-filters are not discarding every entry.","Log the parsed queue length before run() to identify which input source failed to contribute links."],"exampleFix":"// before\ncli.run(Input::Text(\"check my tiktok\".into()), opts).await?;\n// after\nlet input = \"https://www.tiktok.com/@user/video/7301234567890123456\";\ncli.run(Input::Text(input.into()), opts).await?;","handlingStrategy":"validation","validationCode":"// Rust\nfn has_tiktok_urls(input: &str) -> bool {\n    input.lines().any(|l| l.contains(\"tiktok.com/\") && l.contains(\"/video/\"))\n}\nif !has_tiktok_urls(&raw_input) {\n    eprintln!(\"Nenhuma URL do TikTok encontrada na entrada\");\n    return Ok(());\n}","typeGuard":"fn is_non_empty_queue(q: &[Entry]) -> bool { !q.is_empty() }","tryCatchPattern":"match run(opts).await {\n    Ok(items) => process(items),\n    Err(e) if e.to_string().contains(\"nenhum link do TikTok\") => eprintln!(\"Entrada sem links válidos\"),\n    Err(e) => return Err(e),\n}","preventionTips":["Validate that input text or .txt files contain at least one tiktok.com/video URL before invoking run().","Trim and filter blank/comment lines when loading .txt inputs.","Show a live count of parsed links in the UI before starting the download.","Unit-test parse+queue construction with edge-case inputs (empty file, no-URL text)."],"tags":["tiktok","input-validation","empty-input","rust"],"backgroundTag":"empty-required-field","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"}