tonhowtf/omniget · warning

TikTok is blocking requests. Try again in a few minutes.

Error message

TikTok is blocking requests. Try again in a few minutes.

What it means

After fetching the detail page, the HTML is checked with is_captcha_page; if TikTok served a captcha/bot-verification page, fetch_detail aborts with this error. It means TikTok is blocking the scraper rather than returning video data.

Solutions

  1. Wait a few minutes and retry with lower request frequency
  2. Persist and reuse cookies captured from a successful request (captured_cookies)
  3. Route requests through residential/proxy IPs or vary the User-Agent
  4. Prefer official TikTok APIs/oEmbed where possible

Example fix

// caller-side
match fetcher.fetch_detail(&url).await {
    Err(e) if e.to_string().contains("blocking requests") => {
        tokio::time::sleep(Duration::from_secs(120)).await;
        retry_with_new_session()
    }
    other => other,
}
Defensive patterns

Strategy: retry

Validate before calling

let html = client.get(url).send().await?.text().await?;
if TikTokClient::is_captcha_page(&html) {
    return Err("captcha detected; back off before retry".into());
}

Try / catch

match fetch_detail(url).await {
    Err(e) if e.to_string().contains("blocking requests") => {
        sleep(Duration::from_secs(120)).await;
        fetch_detail_with_new_session(url).await
    }
    other => other,
}

Prevention

When it happens

Trigger: The response HTML contains markers like 'verify-bar-close', 'captcha_verify', or 'tiktok-verify-page' — i.e. a challenge page was returned instead of video content.

Common situations: High request volume from one IP, missing or stale cookies, datacenter IPs flagged by TikTok, or requests without realistic browser headers.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/55af5e934c067edb. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/src/platforms/tiktok/mod.rs:159

        let status = response.status();

        if !status.is_success() && status.as_u16() != 302 {
            return Err(anyhow!("TikTok retornou HTTP {}", status));
        }

        let mut cookie_parts = Vec::new();
        for cookie in response.cookies() {
            cookie_parts.push(format!("{}={}", cookie.name(), cookie.value()));
        }
        if !cookie_parts.is_empty() {
            let cookie_str = cookie_parts.join("; ");
            *self.captured_cookies.lock().await = Some(cookie_str);
        }

        let html = response.text().await?;

        if Self::is_captcha_page(&html) {
            return Err(anyhow!(
                "TikTok is blocking requests. Try again in a few minutes."
            ));
        }

        let json_str = html
            .split("<script id=\"__UNIVERSAL_DATA_FOR_REHYDRATION__\" type=\"application/json\">")
            .nth(1)
            .and_then(|s| s.split("</script>").next())
            .ok_or_else(|| anyhow!("TikTok is blocking requests. Try again in a few minutes."))?;

        let data: serde_json::Value = serde_json::from_str(json_str)
            .map_err(|_| anyhow!("Erro ao processar resposta do TikTok"))?;

        let video_detail = data
            .get("__DEFAULT_SCOPE__")
            .and_then(|s| s.get("webapp.video-detail"))
            .ok_or_else(|| anyhow!("Video data not found in TikTok response"))?;

View on GitHub (pinned to 8600b91f42)