tonhowtf/omniget · error · anyhow::Error

nenhuma publicação válida na lista

Error message

nenhuma publicação válida na lista

What it means

After resolving the export targets — either from the session's subscriptions or from a user-provided list of URLs/publication names — substack::run checks whether the resulting targets vector is empty. If no entry could be parsed into a valid publication (custom domain or <name>.substack.com host), the export cannot proceed and this error is raised.

Solutions

  1. Provide valid publication URLs or hosts (e.g. https://example.substack.com or a custom domain) in opts.publications
  2. Log in with a session (capture cookies) so discover() can supply valid subscription targets
  3. Strip protocol/path noise and verify each entry resolves to a publication host before building Options

Example fix

// before
let opts = Options { publications: vec!["my substack".into()], .. };
// after
let opts = Options { publications: vec!["https://mysub.substack.com".into()], .. };
Defensive patterns

Strategy: validation

Validate before calling

fn valid_host(entry: &str) -> bool {
    let e = entry.trim();
    e.ends_with(".substack.com") || (!e.contains(' ') && e.contains('.'))
}
let targets: Vec<_> = opts.publications.iter().filter(|p| valid_host(p)).collect();
if targets.is_empty() { anyhow::bail!("no valid publications provided"); }

Type guard

fn is_publication_url(entry: &str) -> bool {
    entry.starts_with("https://") && (entry.contains(".substack.com/") || entry.contains(".substack.com"))
}

Prevention

When it happens

Trigger: Calling run() with opts.publications containing only entries that fail host parsing (no valid substack.com or custom-domain host), or an empty manual list combined with no usable session subscriptions.

Common situations: User typed publication names by hand with typos or full HTML pasted in; URLs pointing to post pages rather than the publication; pasting 'substack.com' itself rather than a publication domain; non-ASCII or whitespace-only entries filtered out.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/blogs/substack.rs:422

            "discover",
            0,
            None,
            Some("assinaturas".into()),
        );
        discover(&fetcher).await?
    } else {
        opts.publications
            .iter()
            .filter_map(|p| normalize_host(p))
            .map(|host| Subscription {
                name: host.clone(),
                host,
                paid: false,
            })
            .collect()
    };
    if targets.is_empty() {
        return Err(anyhow!("nenhuma publicação válida na lista"));
    }

    let since = opts.since.trim().to_string();
    let mut out = ArchiveResult {
        used_session: fetcher.has_session(),
        dest: root.to_string_lossy().to_string(),
        publications: Vec::new(),
        posts: 0,
        locked: 0,
        images: 0,
        requests: 0,
        files: Vec::new(),
    };

    let total = targets.len() as u64;
    for (i, sub) in targets.iter().enumerate() {
        crate::core::tools::report(
            &progress,

View on GitHub (pinned to 8600b91f42)