{"record":{"id":"2404411fb904d2d6","repo":"tonhowtf/omniget","slug":"os-favoritos-e-os-curtidos-s-saem-com-a-sua-sess-o-capture","errorCode":null,"errorMessage":"os favoritos e os curtidos só saem com a sua sessão: capture os cookies do tiktok.com pela extensão e escolha a conta aqui","messagePattern":"os favoritos e os curtidos só saem com a sua sessão: capture os cookies do tiktok\\.com pela extensão e escolha a conta aqui","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/tiktok/favorites.rs","lineNumber":357,"sourceCode":"            name: handle_of(input),\n        }),\n    };\n    let v = super::ytdlp_json(&super::ytdlp_list_args(&url, limit, cookies)).await?;\n    Ok(entries_from_list(&v))\n}\n\nasync fn list_private(\n    opts: &Options,\n    handle: &str,\n    progress: &ProgressFn,\n    pacer: &Pacer,\n) -> Result<Vec<Entry>> {\n    let session = opts\n        .session_netscape\n        .as_deref()\n        .filter(|c| !c.trim().is_empty())\n        .ok_or_else(|| {\n            anyhow!(\n                \"os favoritos e os curtidos só saem com a sua sessão: capture os cookies do \\\n                 tiktok.com pela extensão e escolha a conta aqui\"\n            )\n        })?;\n    let (client, _) = super::cookie_client(Some(session))?;\n\n    // O `secUid` vem da própria página do perfil, que só abre inteira para\n    // quem está logado.\n    pacer.wait().await;\n    let profile = format!(\"https://www.tiktok.com/@{}\", handle);\n    let html = client.get(&profile).send().await?.text().await?;\n    let sec_uid = parse_sec_uid(&html).ok_or_else(|| {\n        anyhow!(\n            \"não achei o secUid de @{} na página do perfil — a sessão pode ter expirado\",\n            handle\n        )\n    })?;\n","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/tiktok/favorites.rs#L339-L375","documentation":"list_private() (favorites and liked videos) requires the caller's TikTok session cookies; when opts.session_netscape is None or an empty/whitespace string, it aborts with this anyhow error. Favorites/likes are not public, so the library refuses to proceed without credentials.","triggerScenarios":"Calling run with source=favorites or liked while opts.session_netscape is unset, points to an empty file/string, or the user never exported cookies from tiktok.com in Netscape format.","commonSituations":"Fresh install with no cookie export done, user assumed a public listing works for favorites, cookie export saved to a different path than the one configured, or the cookie string was trimmed away by config preprocessing.","solutions":["Export tiktok.com cookies with a browser extension (e.g. 'Get cookies.txt' / Netscape format) while logged into the account.","Set opts.session_netscape to the path of the exported cookies.txt before calling run().","Confirm the exported file is non-empty and in Netscape format (starts with '# Netscape HTTP Cookie File').","If you intended public content, switch the source to a public profile/collection instead of favorites/liked."],"exampleFix":"// before\nlet opts = FavoritesOpts { source: \"favorites\".into(), session_netscape: None, ..Default::default() };\n// after\nlet opts = FavoritesOpts { source: \"favorites\".into(), session_netscape: Some(\"cookies.txt\".into()), ..Default::default() };","handlingStrategy":"validation","validationCode":"// Rust\nfn session_ready(path: &Option<String>) -> bool {\n    path.as_deref().map(|p| std::fs::metadata(p).map(|m| m.len() > 0).unwrap_or(false)).unwrap_or(false)\n}\nif !session_ready(&opts.session_netscape) {\n    eprintln!(\"Exporte os cookies do tiktok.com antes de listar favoritos\");\n}","typeGuard":"fn has_session(opts: &FavoritesOpts) -> bool {\n    opts.session_netscape.as_deref().map_or(false, |s| !s.trim().is_empty())\n}","tryCatchPattern":"match run(opts).await {\n    Ok(entries) => render(entries),\n    Err(e) if e.to_string().contains(\"só saem com a sua sessão\") => eprintln!(\"Configure session_netscape com um cookies.txt válido\"),\n    Err(e) => return Err(e),\n}","preventionTips":["Always export tiktok.com cookies in Netscape format before using favorites/liked sources.","Check the cookie file exists and is non-empty before calling the API.","Refresh the cookie export regularly (sessions expire).","In UIs, gate favorites/liked features behind a 'session configured' check."],"tags":["tiktok","authentication","cookies","session","rust"],"backgroundTag":"authentication-required","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"}