tonhowtf/omniget · error · anyhow::Error
a sessão do Medium não listou nenhuma história sua (a…
Error message
a sessão do Medium não listou nenhuma história sua (a sessão pode ter expirado)
What it means
from_session() lists your stories (public and drafts) using the authenticated Medium session. If the session responded successfully but parsed to zero story references, the exporter assumes the session is stale/expired and throws this error instead of exporting nothing.
Solutions
- Re-capture fresh medium.com cookies in the session manager and retry
- Log in to medium.com in the browser to confirm the session is actually valid
- Fall back to the public RSS feed path by setting opts.user
- If the API shape changed, update parse_story_list to match the current Medium JSON schema
Defensive patterns
Strategy: retry
Validate before calling
// before calling run with session mode, verify cookies work:
let probe = fetcher.get_json(&list_url("drafts")).await;
if probe.is_err() { /* ask user to re-capture cookies */ } Try / catch
match run(&opts, progress).await {
Err(e) if e.to_string().contains("sessão do Medium") => {
reauthenticate_and_retry().await?;
}
other => other?,
} Prevention
- Refresh medium.com cookies regularly; they expire
- Confirm the browser session is alive before capturing cookies
- Keep the public-feed fallback (opts.user) configured as backup
When it happens
Trigger: Calling run() with session cookies enabled such that from_session runs; list_url("drafts") and the other listing endpoints returned JSON that parse_story_list converted to an empty refs list (or only drafts fetch errors were logged as warnings).
Common situations: Expired or revoked medium.com session cookies; cookies captured from a different browser profile than the logged-in account; Medium changed the private listing API shape so parse_story_list finds no stories.
Related errors
- o X serviu a versao deslogada da pagina
- sem a sessão do Substack não dá para listar as suas…
- a sessão do Goodreads não está válida: capture os cookies…
- os favoritos e os curtidos só saem com a sua sessão…
- X_LOGIN_REQUIRED
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/09a1ea151ed9734e.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/blogs/medium.rs:770
}
async fn from_session(
fetcher: &Fetcher,
opts: &Options,
progress: &ProgressFn,
) -> Result<Vec<PostDoc>> {
let mut refs: Vec<StoryRef> = Vec::new();
crate::core::tools::report(&progress.clone(), ID, "list", 0, None, None);
let public = fetcher.get_json(&list_url("public")).await?;
refs.extend(parse_story_list(&public, false));
if opts.drafts {
match fetcher.get_json(&list_url("drafts")).await {
Ok(v) => refs.extend(parse_story_list(&v, true)),
Err(e) => tracing::warn!("medium: rascunhos não vieram: {}", e),
}
}
if refs.is_empty() {
return Err(anyhow!(
"a sessão do Medium não listou nenhuma história sua (a sessão pode ter expirado)"
));
}
if opts.limit > 0 && refs.len() > opts.limit {
refs.truncate(opts.limit);
}
let mut docs = Vec::new();
let total = refs.len() as u64;
for (i, r) in refs.iter().enumerate() {
if fetcher.requests() >= opts.max_requests {
break;
}
crate::core::tools::report(
progress,
ID,
"story",
i as u64,View on GitHub (pinned to 8600b91f42)