{"record":{"id":"789fd2d08d26ad31","repo":"tonhowtf/omniget","slug":"vimeo-bad-url","errorCode":"vimeo:bad_url","errorMessage":"vimeo:bad_url","messagePattern":"vimeo:bad_url","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/vimeo.rs","lineNumber":852,"sourceCode":"        file,\n        meta,\n        tail,\n        success: status.success(),\n    })\n}\n\nfn secret_refs<'a>(a: Option<&'a String>, b: Option<&'a String>) -> Vec<&'a str> {\n    [a, b]\n        .into_iter()\n        .flatten()\n        .map(|s| s.as_str())\n        .filter(|s| !s.trim().is_empty())\n        .collect()\n}\n\n/// Enumera um showcase, álbum, canal ou perfil.\npub async fn list(opts: &ListOptions, progress: &ProgressFn) -> Result<Listing> {\n    let target = parse_target(&opts.url).ok_or_else(|| anyhow!(\"vimeo:bad_url\"))?;\n    if !target.is_collection() {\n        return Err(anyhow!(\"vimeo:not_a_collection\"));\n    }\n    let url = target.canonical_url();\n    let bin = ytdlp_bin().await?;\n    let cookies = cookie_file(opts.session_netscape.as_deref());\n    let used_session = cookies.is_some();\n    let secrets = secret_refs(opts.showcase_password.as_ref(), None);\n    let args = list_args(\n        &url,\n        opts.showcase_password.as_deref(),\n        cookies.as_ref().map(|c| c.path.as_path()),\n    );\n    let command = safe_command_line(\"yt-dlp\", &args);\n    tracing::info!(\"[vimeo] $ {}\", command);\n    report(\n        progress,\n        ID_SHOWCASE,","sourceCodeStart":834,"sourceCodeEnd":870,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/vimeo.rs#L834-L870","documentation":"vimeo:bad_url is raised by the `list` function when `parse_target(&opts.url)` returns None, meaning the provided URL (or bare id) is empty or not a Vimeo link shape the library recognizes. The library only accepts numeric video ids, showcase/album/channel/user URLs, and unlisted video links (`vimeo.com/<id>/<hash>`). It is a fail-fast validation error thrown before any yt-dlp process is spawned.","triggerScenarios":"Calling `list(opts)` with an empty `opts.url`, a non-Vimeo URL (e.g. youtube.com), a malformed Vimeo URL (e.g. `vimeo.com/showcase/` with no id), or a URL with a path segment shape parse_target does not handle.","commonSituations":"Users pasting a Vimeo player embed URL or an oEmbed/lti link instead of the showcase URL; frontend sending an empty url field because a form input was not bound; trailing junk or a localized Vimeo domain the parser does not recognize.","solutions":["Inspect `opts.url` and replace it with a valid Vimeo collection URL such as https://vimeo.com/showcase/<id>, https://vimeo.com/album/<id>, https://vimeo.com/channels/<name>, or https://vimeo.com/<username>.","Trim whitespace and ensure the field is not empty before calling list(); an empty/whitespace string returns None.","If you only have a bare numeric id, pass the id alone (e.g. \"123456789\") — but note bare ids parse as Target::Video and will then fail vimeo:not_a_collection.","Check src-tauri/omniget-core/src/core/tools/vimeo.rs parse_target (line 98) for the exact accepted URL shapes and match your input to one of them."],"exampleFix":"// before\nawait vimeoList({ url: inputValue });\n// after\nconst url = (inputValue ?? \"\").trim();\nif (!/^https:\\/\\/vimeo\\.com\\/(showcase|album)\\/[\\w-]+/.test(url) &&\n    !/^https:\\/\\/vimeo\\.com\\/channels\\/[\\w-]+/.test(url) &&\n    !/^https:\\/\\/vimeo\\.com\\/[\\w-]+$/.test(url)) {\n  throw new Error(\"not a supported Vimeo collection URL\");\n}\nawait vimeoList({ url });","handlingStrategy":"validation","validationCode":"const COLLECTION_RE = /^https:\\/\\/vimeo\\.com\\/(showcase\\/[\\w-]+|album\\/[\\w-]+|channels\\/[\\w-]+|[\\w-]+)\\/?$/;\nfunction isValidVimeoCollectionUrl(u) {\n  const s = (u ?? \"\").trim();\n  return COLLECTION_RE.test(s) && !/^https:\\/\\/vimeo\\.com\\/\\d+\\/?$/.test(s);\n}\nif (!isValidVimeoCollectionUrl(opts.url)) throw new Error(\"invalid vimeo collection url\");","typeGuard":"function isNonEmptyVimeoUrl(u) {\n  return typeof u === \"string\" && u.trim().length > 0 && /vimeo\\.com|\\d+/.test(u.trim());\n}","tryCatchPattern":"try {\n  await vimeoList({ url });\n} catch (e) {\n  if (String(e).includes(\"vimeo:bad_url\")) {\n    showError(\"Please paste a Vimeo showcase/album/channel/profile URL\");\n  } else throw e;\n}","preventionTips":["Trim and non-empty-check every URL field before calling the API","Use a regex whitelist of accepted Vimeo URL shapes in the UI","Convert player.vimeo.com links to canonical vimeo.com links before submitting","Test with one URL of each accepted shape when upgrading the library"],"tags":["url-validation","vimeo","input-error","rust"],"backgroundTag":"invalid-url-format","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"}