tonhowtf/omniget · error

o Letterboxd devolveu uma página em vez do ZIP — a sessão…

Error message

o Letterboxd devolveu uma página em vez do ZIP — a sessão salva expirou; capture os cookies de novo

What it means

Same check as the Cloudflare-wall case (HTML response or body under 200 bytes from EXPORT_URL), but the body is NOT a Cloudflare challenge page. The tool concludes the session cookies no longer authenticate the download — Letterboxd served a generic HTML page (e.g. login or expired-session page) instead of the ZIP.

Solutions

  1. Re-capture fresh cookies from letterboxd.com while logged in, then re-run the tool.
  2. Download the export manually at letterboxd.com/settings/data/ and pass opts.zip_path.
  3. Log in to letterboxd.com in the browser to confirm the account session is actually alive.
  4. Confirm the cookies file includes all Letterboxd cookies (not a partial/filtered capture).

Example fix

// before
let opts = Options { session_netscape: Some("captured-2-months-ago.txt".into()), .. };
run(&opts, p).await?; // session expired
// after
let opts = Options { session_netscape: Some("fresh_cookies.txt".into()), .. }; // re-captured today
run(&opts, p).await?;
Defensive patterns

Strategy: retry

Validate before calling

let cookies = std::fs::read_to_string(opts.session_netscape.as_deref().unwrap_or(""))?;
anyhow::ensure!(cookies.lines().any(|l| l.contains("letterboxd")), "cookies do Letterboxd ausentes no arquivo de sessão");

Type guard

fn has_letterboxd_cookies(session_file: &str) -> bool {
    std::fs::read_to_string(session_file)
        .map(|c| c.lines().any(|l| l.contains("letterboxd")))
        .unwrap_or(false)
}

Try / catch

match letterboxd::run(&opts, &p).await {
    Err(e) if e.to_string().contains("sessão salva expirou") => {
        eprintln!("recapture os cookies de letterboxd.com e rode novamente");
        // retry once with fresh cookies
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling run without zip_path; f.get_bytes(EXPORT_URL) returns content-type containing 'text/html' or fewer than 200 bytes; is_cloudflare_wall is false; the saved cookies are stale/invalid/logged-out.

Common situations: Letterboxd session expired (weeks old cookies); user logged out of Letterboxd in the browser after capture; cookies captured for the wrong account or domain; Letterboxd invalidated sessions server-side.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/lists/letterboxd.rs:392

                ));
            }
            report(
                &p,
                TOOL_ID,
                "progress",
                0,
                Some(3),
                Some(EXPORT_URL.to_string()),
            );
            let (b, ctype) = f.get_bytes(EXPORT_URL).await?;
            if ctype.contains("text/html") || b.len() < 200 {
                let body = String::from_utf8_lossy(&b);
                if is_cloudflare_wall(&body) {
                    return Err(anyhow!(
                        "o Cloudflare do Letterboxd barrou o download. Abra letterboxd.com no navegador, passe pelo \"Just a moment\" e capture os cookies de novo na extensão — o cf_clearance precisa vir junto"
                    ));
                }
                return Err(anyhow!(
                    "o Letterboxd devolveu uma página em vez do ZIP — a sessão salva expirou; capture os cookies de novo"
                ));
            }
            (b, EXPORT_URL.to_string())
        }
    };
    if opts.keep_zip {
        let _ = std::fs::write(dest.join("letterboxd-export.zip"), &bytes);
    }

    // 2. Normalização.
    report(
        &p,
        TOOL_ID,
        "progress",
        1,
        Some(3),
        Some("lendo o export".into()),

View on GitHub (pinned to 8600b91f42)