{"record":{"id":"49574427beb7d9b3","repo":"tonhowtf/omniget","slug":"isso-um-v-deo-n-o-um-perfil","errorCode":null,"errorMessage":"isso é um vídeo, não um perfil: {}","messagePattern":"isso é um vídeo, não um perfil: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/tiktok/download.rs","lineNumber":127,"sourceCode":"        }\n    }\n    if limit > 0 && out.len() > limit as usize {\n        out.truncate(limit as usize);\n    }\n    out\n}\n\n/// Lista os vídeos de um perfil ou coleção com uma só chamada de yt-dlp.\nasync fn expand_profile(\n    input: &str,\n    limit: u32,\n    cookies: Option<&std::path::Path>,\n) -> Result<Vec<String>> {\n    let target = parse_target(input)\n        .ok_or_else(|| anyhow!(\"não reconheci esse perfil ou coleção: {}\", input))?;\n    match target {\n        Target::User { .. } | Target::Collection { .. } | Target::Music { .. } => {}\n        _ => return Err(anyhow!(\"isso é um vídeo, não um perfil: {}\", input)),\n    }\n    let url = canonical_url(&target);\n    let v = super::ytdlp_json(&super::ytdlp_list_args(&url, limit, cookies)).await?;\n    let entries = super::favorites::entries_from_list(&v);\n    Ok(entries.into_iter().map(|e| e.url).collect())\n}\n\nfn cookies_path(opts: &Options, session: &TempCookies) -> Option<PathBuf> {\n    if let Some(c) = opts.cookies.as_deref().filter(|c| !c.trim().is_empty()) {\n        return Some(PathBuf::from(c));\n    }\n    session.path().map(|p| p.to_path_buf())\n}\n\npub async fn run(opts: &Options, progress: ProgressFn) -> Result<DownloadResult> {\n    let dest = PathBuf::from(&opts.dest);\n    if opts.dest.trim().is_empty() {\n        return Err(anyhow!(\"escolha a pasta de destino\"));","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/tiktok/download.rs#L109-L145","documentation":"After parse_target succeeds, expand_profile matches on the Target variant; anything that is not User/Collection/Music (i.e. a single video target) is rejected with \"isso é um vídeo, não um perfil: {input}\" (this is a video, not a profile). It enforces that profile expansion only handles list-like targets.","triggerScenarios":"Calling run with opts.profile set to a URL that parses as a single TikTok video (e.g. https://www.tiktok.com/@user/video/123...), so the match falls through to the error arm.","commonSituations":"Copying a video URL into the profile field of the UI/CLI; automation filling the wrong option (profile vs url); a URL shape that parse_target classifies as Video rather than User.","solutions":["Put video URLs in opts.urls instead of opts.profile","Use a profile/collection/music URL for profile expansion","Detect the target type with parse_target in caller code and route videos to the single-video path"],"exampleFix":"// before\nrun(&Options { profile: Some(\"https://www.tiktok.com/@u/video/123\".into()), .. })\n// after\nrun(&Options { urls: vec![\"https://www.tiktok.com/@u/video/123\".into()], .. })","handlingStrategy":"type-guard","validationCode":"let is_video = input.contains(\"/video/\");\nif is_video { /* route to single-video download via opts.urls */ }","typeGuard":"fn is_video_url(input: &str) -> bool {\n    input.contains(\"/video/\") || input.contains(\"/photo/\")\n}","tryCatchPattern":"match run(&opts, progress).await {\n    Err(e) if e.to_string().contains(\"isso é um vídeo\") => {\n        // move the URL from opts.profile to opts.urls and retry as video\n    }\n    other => other,\n}","preventionTips":["Route video URLs to opts.urls, never opts.profile","Pre-classify input with parse_target in the UI","Keep separate input fields for video vs profile"],"tags":["tiktok","wrong-target-type","invalid-argument","url-parsing","rust"],"backgroundTag":"incompatible-source-type","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"}