tonhowtf/omniget · error · anyhow::Error

nenhum link de vídeo do TikTok na entrada

Error message

nenhum link de vídeo do TikTok na entrada

What it means

After merging URLs from opts.urls and the optional list file through expand_inputs, sound::run requires at least one TikTok video link to process. If the resulting queue is empty there is nothing to download, so it throws this error instead of running zero jobs.

Solutions

  1. Put at least one valid TikTok video URL in opts.urls
  2. Check that the list file actually contains video links, one per line or as supported by expand_inputs
  3. Confirm the input strings are TikTok video URLs, not sound/shortened/garbage text

Example fix

// before
let opts = Options { urls: vec![], list_file: Some("".into()), ..opts };
run(&opts, progress).await?;
// after
let opts = Options { urls: vec!["https://www.tiktok.com/@user/video/123".into()], list_file: Some("".into()), ..opts };
run(&opts, progress).await?;
Defensive patterns

Strategy: validation

Validate before calling

let has_input = !opts.urls.is_empty()
    || opts.list_file.as_deref().filter(|p| !p.trim().is_empty())
        .and_then(|p| std::fs::read_to_string(p).ok())
        .map_or(false, |t| !t.trim().is_empty());
anyhow::ensure!(has_input, "informe ao menos um link de vídeo do TikTok");

Prevention

When it happens

Trigger: opts.urls is empty and opts.list_file is empty/absent (read as empty String); or expand_inputs filtered out all provided inputs as non-video-link entries.

Common situations: Caller passes only a music/sound URL or non-TikTok text into urls; list file exists but is empty; inputs were provided in the wrong field (e.g. format instead of urls); user pasted plain text that expand_inputs does not recognize.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/34623aba042980e1. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/tiktok/sound.rs:316

        .cookies
        .as_deref()
        .filter(|c| !c.trim().is_empty())
        .map(PathBuf::from)
        .or_else(|| session.path().map(|p| p.to_path_buf()));

    let list_text = match opts.list_file.as_deref().filter(|p| !p.trim().is_empty()) {
        Some(path) => std::fs::read_to_string(path)
            .map_err(|e| anyhow!("não consegui ler a lista {}: {}", path, e))?,
        None => String::new(),
    };
    let mut queue = expand_inputs(&opts.urls);
    for url in expand_inputs(&list_text) {
        if !queue.contains(&url) {
            queue.push(url);
        }
    }
    if queue.is_empty() {
        return Err(anyhow!("nenhum link de vídeo do TikTok na entrada"));
    }

    let audio_format = match opts.format.as_str() {
        "m4a" => "m4a",
        "best" => "best",
        _ => "mp3",
    };
    let ffmpeg = crate::core::dependencies::find_tool("ffmpeg").await;
    let (client, _) = super::cookie_client(opts.session_netscape.as_deref())?;
    let pacer = Pacer::new(opts.delay_ms);
    let total = queue.len() as u64;
    let mut items: Vec<SoundItem> = Vec::with_capacity(queue.len());

    for (i, url) in queue.iter().enumerate() {
        report(
            &progress,
            ID,
            "progress",

View on GitHub (pinned to 8600b91f42)