tonhowtf/omniget · error

Return YouTube Dislike: HTTP

Error message

Return YouTube Dislike: HTTP {}

What it means

ryd::votes() queries the Return YouTube Dislike API at {API}/votes?videoId=. If the HTTP response status is not a success (4xx/5xx), the status code is wrapped in this error. RYD only has data for videos it has seen, so 404 for unknown videos is the most common case.

Solutions

  1. Verify the video id is correct — a 404 usually means RYD has no data for that video
  2. Handle the 404 case gracefully: treat missing dislike data as unknown, not zero
  3. Add backoff/retry for 429/5xx responses
  4. Check RYD service status (returnyoutubedislike.com) if many requests fail at once

Example fix

// before
let v = votes(id).await?; // hard-fails on 404
// after
match votes(id).await {
    Ok(v) => Some(v),
    Err(e) if e.to_string().contains("404") => None, // no RYD data
    Err(e) => return Err(e),
}
Defensive patterns

Strategy: try-catch

Validate before calling

let id_ok = id.len() == 11 && id.chars().all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-');
if !id_ok { eprintln!("malformed videoId, RYD will 404: {}", id); }

Try / catch

match ryd::votes(id).await {
    Ok(v) => Some(v),
    Err(e) if e.to_string().contains("404") => None, // no RYD data for this video
    Err(e) if e.to_string().contains("429") => { backoff().await; retry(id).await }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling votes() for a videoId the RYD backend has no record of (404), rate limiting (429), or API downtime/outages (5xx).

Common situations: Querying a brand-new or very low-traffic video never indexed by the extension community; RYD service outages; aggressive polling of many videos hitting rate limits.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/ryd.rs:34

    pub dislikes: u64,
    #[serde(default)]
    pub rating: f64,
    #[serde(rename = "viewCount", default)]
    pub view_count: u64,
    #[serde(default)]
    pub deleted: bool,
}

pub async fn votes(input: &str) -> anyhow::Result<Votes> {
    let id = super::sponsorblock::video_id(input)
        .ok_or_else(|| anyhow!("nao reconheci um video do YouTube em: {}", input))?;
    let client = super::client()?;
    let resp = client
        .get(format!("{}/votes?videoId={}", API, id))
        .send()
        .await?;
    if !resp.status().is_success() {
        return Err(anyhow!("Return YouTube Dislike: HTTP {}", resp.status()));
    }
    Ok(resp.json().await?)
}

View on GitHub (pinned to 8600b91f42)