tonhowtf/omniget · error

informe o blog dos likes

Error message

informe o blog dos likes

What it means

Required-argument guard in tumblr likes run: the blog identifier, after building the likes URL, produced an empty string — no API endpoint can be constructed, so the export is refused before any network call.

Solutions

  1. Set the `blog` field to the Tumblr blog whose likes should be exported
  2. Validate (trim + non-empty check) before invoking run
  3. Fix the CLI/config-to-Options wiring if the value is being dropped

Example fix

// before
let opts = Options { blog: "".into(), .. };
// after
let opts = Options { blog: "someblog".into(), .. };
Defensive patterns

Strategy: validation

Validate before calling

if opts.blog.trim().is_empty() {
    return Err(anyhow!("blog dos likes é obrigatório"));
}

Type guard

fn blog_is_set(opts: &likes::Options) -> bool {
    !opts.blog.trim().is_empty()
}

Try / catch

match likes::run(&opts, progress).await {
    Err(e) if e.to_string() == "informe o blog dos likes" => eprintln!("configure o campo blog"),
    Err(e) => return Err(e),
    Ok(r) => use(r),
}

Prevention

When it happens

Trigger: Calling likes `run` with Options whose `blog` field is empty or blank, making likes_url() return an empty string.

Common situations: Blog name omitted from config/CLI; flag typo so the value never reaches Options; programmatically constructed Options left at defaults.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/tumblr/likes.rs:316

            r.post_id.clone(),
            r.blog.clone(),
            r.date.clone(),
            r.kind.clone(),
            r.tags.join(" "),
            r.post_url.clone(),
            r.summary.replace(['\n', '\r'], " "),
            r.note_count.to_string(),
            r.media_urls.join(" | "),
            r.local_files.join(" | "),
        ]));
    }
    out
}

pub async fn run(opts: &Options, progress: &super::super::ProgressFn) -> Result<LikesResult> {
    let url = likes_url(&opts.blog);
    if url.is_empty() {
        anyhow::bail!("informe o blog dos likes");
    }
    let cookies = match opts.session_netscape.as_deref() {
        Some(s) => gdl::write_cookies(s, &["tumblr.com"])?,
        None => None,
    };
    let used_session = cookies.is_some();

    super::super::report(progress, TOOL_ID, "started", 0, None, Some(url.clone()));
    let extra = vec![
        "-o".to_string(),
        "extractor.tumblr.posts=all".to_string(),
        "-o".to_string(),
        "extractor.tumblr.original=true".to_string(),
    ];
    let entries = gdl::dump(
        &url,
        cookies.as_ref().map(|c| c.path.as_path()),
        opts.limit,

View on GitHub (pinned to 8600b91f42)