{"record":{"id":"2f7322f99233cd55","repo":"tonhowtf/omniget","slug":"a-lista-voltou-vazia-o-tiktok-n-o-entregou-os-favoritos-para","errorCode":null,"errorMessage":"a lista voltou vazia — o TikTok não entregou os favoritos para esta sessão","messagePattern":"a lista voltou vazia — o TikTok não entregou os favoritos para esta sessão","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/tiktok/favorites.rs","lineNumber":424,"sourceCode":"            if !out.iter().any(|x| x.id == e.id) {\n                out.push(e);\n            }\n        }\n        report(\n            progress,\n            ID,\n            \"progress\",\n            out.len() as u64,\n            None,\n            Some(format!(\"{} itens\", out.len())),\n        );\n        if vazio || !has_more || next.is_empty() || next == cursor || out.len() as u32 >= teto {\n            break;\n        }\n        cursor = next;\n    }\n    if out.is_empty() {\n        return Err(anyhow!(\n            \"a lista voltou vazia — o TikTok não entregou os favoritos para esta sessão\"\n        ));\n    }\n    Ok(out)\n}\n\npub async fn run(opts: &Options, progress: ProgressFn) -> Result<FavoritesResult> {\n    if opts.user.trim().is_empty() {\n        return Err(anyhow!(\"informe o perfil (@usuario) ou a URL da coleção\"));\n    }\n    if opts.dest.trim().is_empty() {\n        return Err(anyhow!(\"escolha a pasta de destino\"));\n    }\n    let dest = PathBuf::from(&opts.dest);\n    std::fs::create_dir_all(&dest)?;\n\n    let session = TempCookies::new(opts.session_netscape.as_deref());\n    let used_session = session.is_some();","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/tiktok/favorites.rs#L406-L442","documentation":"After exhausting pagination (or breaking early), list_private() checks the accumulated results and raises this anyhow error when zero entries were collected. It distinguishes 'session worked but TikTok returned no items' from the earlier hard failures, indicating TikTok withheld the favorites for this session.","triggerScenarios":"The loop completed with every page empty (page.is_empty() → vazio=true breaks immediately), or has_more/next cursor never advanced, leaving out empty — often with sessions lacking full visibility into the target list or a genuinely empty favorites list.","commonSituations":"Account has favorites hidden/private relative to the session; favorites list genuinely empty; TikTok silently filtering results for the session (soft bot detection); wrong account's cookies used for someone else's favorites.","solutions":["Confirm in the browser, logged in with the same session, that the account actually has favorites/liked videos visible.","Make sure the cookies belong to the same account whose favorites you are listing.","Re-export fresh cookies and retry — a degraded session may pass checks but yield no data.","If the list is intentionally empty, treat zero entries as a normal outcome instead of an error in your caller."],"exampleFix":"// before\nlet entries = favorites::run(opts).await?; // errors on empty\n// after\nlet entries = match favorites::run(opts).await {\n    Ok(e) => e,\n    Err(e) if e.to_string().contains(\"voltou vazia\") => Vec::new(),\n    Err(e) => return Err(e),\n};","handlingStrategy":"try-catch","validationCode":"// Rust\n// Check in a browser (same account) that favorites/liked are non-empty and visible before batch runs.","typeGuard":null,"tryCatchPattern":"match run(opts).await {\n    Ok(entries) if entries.is_empty() => eprintln!(\"Conta sem favoritos visíveis para esta sessão\"),\n    Ok(entries) => render(entries),\n    Err(e) if e.to_string().contains(\"voltou vazia\") => eprintln!(\"TikTok não entregou favoritos: confira a sessão/conta\"),\n    Err(e) => return Err(e),\n}","preventionTips":["Use cookies from the same account whose favorites you list.","Confirm the list is non-empty and visible in the browser first.","Re-export cookies if the session has degraded (passes checks but yields no data).","Treat genuinely empty lists as a normal result in your app rather than retrying."],"tags":["tiktok","empty-result","session","scraping","rust"],"backgroundTag":"empty-result-set","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}