tonhowtf/omniget · error
Could not resolve short link
Error message
Could not resolve short link
What it means
resolve_short_link walks the redirect target extracted from the short-link page and, if no resolvable full URL is found in the HTML, returns this error. It means a TikTok short link (vm.tiktok.com / vt.tiktok.com style) could not be converted to a canonical video URL.
Solutions
- Retry later — the failure is often a transient bot-wall
- Follow HTTP redirects directly (send with redirect policy enabled) instead of scraping HTML
- Update the extraction patterns to match TikTok's current page markup
- Ask the user for the full canonical tiktok.com/@user/video/ID URL
Example fix
// before: scrape HTML for the target URL
Err(anyhow!("Could not resolve short link"))
// after: follow redirects natively
let resp = self.client.get(short_url).send().await?;
let full = resp.url().to_string();
if !full.contains("/video/") { return Err(anyhow!("Could not resolve short link: {}", full)); } Defensive patterns
Strategy: fallback
Validate before calling
if url.contains("vm.tiktok.com") || url.contains("vt.tiktok.com") {
// expect resolution step; pre-check the link responds
} Type guard
fn is_short_link(url: &str) -> bool {
url.contains("vm.tiktok.com") || url.contains("vt.tiktok.com")
} Try / catch
match resolve_short_link(url).await {
Err(e) if e.to_string().contains("Could not resolve short link") => {
ask_user_for_full_url(url)
}
other => other,
} Prevention
- Prefer full canonical tiktok.com/@user/video/ID URLs over short links
- Detect captcha pages before attempting URL extraction
- Keep HTTP redirect following enabled and use response.url() when possible
When it happens
Trigger: get_media_info receives a short TikTok link and the fetched page contains none of the expected URL patterns (e.g. the page is a captcha, an app-download interstitial, or the redirect markup changed).
Common situations: Expired or deleted short links, TikTok serving a captcha/bot wall instead of a redirect page, or TikTok changing the HTML structure that resolve_short_link scrapes.
Understand the failure class
Background: "Invalid URL" / "URL cannot be empty": fix the malformed or missing URL behind request-construction failures — this error's family across 50 libraries.
Related errors
- Could not resolve short link
- não achei o secUid de @
- a lista voltou vazia — o TikTok não entregou os favoritos…
- TikTok retornou HTTP
- TikTok is blocking requests. Try again in a few minutes.
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/7b68b06afd8a9a0f.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/src/platforms/tiktok/mod.rs:111
.headers()
.get("location")
.and_then(|v| v.to_str().ok())
{
let clean = location.split('?').next().unwrap_or(location).to_string();
return Ok(clean);
}
let html = response.text().await?;
if html.starts_with("<a href=\"https://") {
if let Some(url_part) = html.split("<a href=\"").nth(1) {
let full_url = url_part.split('"').next().unwrap_or(url_part);
let clean = full_url.split('?').next().unwrap_or(full_url).to_string();
return Ok(clean);
}
}
Err(anyhow!("Could not resolve short link"))
}
fn is_captcha_page(html: &str) -> bool {
html.contains("verify-bar-close")
|| html.contains("captcha_verify")
|| html.contains("tiktok-verify-page")
|| html.contains("verify/page")
|| (html.contains("Verify to continue")
&& !html.contains("__UNIVERSAL_DATA_FOR_REHYDRATION__"))
}
fn is_valid_play_addr(url: &str) -> bool {
if url.is_empty() {
return false;
}
if !url.starts_with("http://") && !url.starts_with("https://") {
return false;
}View on GitHub (pinned to 8600b91f42)