tonhowtf/omniget · error

sem sessão do Goodreads: capture os cookies de…

Error message

sem sessão do Goodreads: capture os cookies de goodreads.com na extensão, ou aponte o goodreads_library_export.csv que você já baixou

What it means

Thrown by the Goodreads export tool's run() when no local CSV path was provided and the Fetcher has no captured Goodreads session cookies (f.has_session() is false). Without cookies the tool cannot drive goodreads.com to generate and download the export, so it fails fast with instructions.

Solutions

  1. Capture cookies for goodreads.com in the browser extension and pass them via opts.session_netscape.
  2. Export your library manually at goodreads.com/review/import and pass the downloaded goodreads_library_export.csv path via opts.csv_path.
  3. Verify the session_netscape file actually contains Netscape-format cookie lines for the goodreads.com domain.
  4. Re-capture cookies if they were captured before logging in to Goodreads (anonymous cookies don't count as a session).

Example fix

// before
let opts = Options { csv_path: None, session_netscape: None, .. };
tool::run(&opts, p).await?;
// after
let opts = Options {
    csv_path: Some("./goodreads_library_export.csv".into()), // or session_netscape: Some(cookies_path.into())
    ..
};
tool::run(&opts, p).await?;
Defensive patterns

Strategy: validation

Validate before calling

let has_local = opts.csv_path.as_deref().map(str::trim).map(|p| std::path::Path::new(p).is_file()).unwrap_or(false);
let has_cookies = opts.session_netscape.is_some();
anyhow::ensure!(has_local || has_cookies, "preciso de um CSV local ou de cookies do Goodreads");

Type guard

fn can_run_goodreads(opts: &Options) -> bool {
    opts.csv_path.as_deref().map(|p| !p.trim().is_empty()).unwrap_or(false)
        || opts.session_netscape.is_some()
}

Try / catch

match run(&opts, &p).await {
    Err(e) if e.to_string().contains("sem sessão do Goodreads") => {
        eprintln!("abra goodreads.com, capture os cookies na extensão e tente de novo");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling run with opts.csv_path = None and opts.session_netscape = None (or cookies that failed to load into the Fetcher), so neither a local file nor an authenticated download path is available.

Common situations: User never captured cookies in the extension; cookies were captured for the wrong domain; session_netscape points to an empty/missing file; user assumed the tool could download the export anonymously (Goodreads requires a logged-in session for exports).

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/lists/goodreads.rs:525

// ── Execução ────────────────────────────────────────────────────────────

pub async fn run(opts: &Options, p: ProgressFn) -> Result<ExportResult> {
    if opts.dest.trim().is_empty() {
        return Err(anyhow!("escolha a pasta de destino"));
    }
    let dest = PathBuf::from(opts.dest.trim());
    std::fs::create_dir_all(&dest)?;
    let f = Fetcher::new(opts.delay_ms, opts.session_netscape.as_deref(), DOMAIN)?;

    let (csv, source, waited) = match opts.csv_path.as_deref().map(str::trim) {
        Some(path) if !path.is_empty() => (
            std::fs::read_to_string(path).with_context(|| format!("não consegui ler {}", path))?,
            path.to_string(),
            0,
        ),
        _ => {
            if !f.has_session() {
                return Err(anyhow!(
                    "sem sessão do Goodreads: capture os cookies de goodreads.com na extensão, ou aponte o goodreads_library_export.csv que você já baixou"
                ));
            }
            let (csv, secs) = trigger_and_wait(&f, opts, &p).await?;
            let _ = std::fs::write(dest.join("goodreads_library_export.csv"), &csv);
            (csv, EXPORT_BASE.to_string(), secs)
        }
    };

    let mut entries = parse_export_csv(&csv);
    if entries.is_empty() {
        return Err(anyhow!("o export veio sem nenhum livro"));
    }

    // Reviews que o CSV não trouxe, buscadas na prateleira.
    let mut enriched = 0usize;
    if !opts.enrich_shelves.is_empty() && f.has_session() {
        let page = f.get_text(IMPORT_URL).await.unwrap_or_default();

View on GitHub (pinned to 8600b91f42)