{"record":{"id":"ac899860236dd586","repo":"tonhowtf/omniget","slug":"return-youtube-dislike-http","errorCode":null,"errorMessage":"Return YouTube Dislike: HTTP {}","messagePattern":"Return YouTube Dislike: HTTP (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/ryd.rs","lineNumber":34,"sourceCode":"    pub dislikes: u64,\n    #[serde(default)]\n    pub rating: f64,\n    #[serde(rename = \"viewCount\", default)]\n    pub view_count: u64,\n    #[serde(default)]\n    pub deleted: bool,\n}\n\npub async fn votes(input: &str) -> anyhow::Result<Votes> {\n    let id = super::sponsorblock::video_id(input)\n        .ok_or_else(|| anyhow!(\"nao reconheci um video do YouTube em: {}\", input))?;\n    let client = super::client()?;\n    let resp = client\n        .get(format!(\"{}/votes?videoId={}\", API, id))\n        .send()\n        .await?;\n    if !resp.status().is_success() {\n        return Err(anyhow!(\"Return YouTube Dislike: HTTP {}\", resp.status()));\n    }\n    Ok(resp.json().await?)\n}\n","sourceCodeStart":16,"sourceCodeEnd":38,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/ryd.rs#L16-L38","documentation":"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.","triggerScenarios":"Calling votes() for a videoId the RYD backend has no record of (404), rate limiting (429), or API downtime/outages (5xx).","commonSituations":"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.","solutions":["Verify the video id is correct — a 404 usually means RYD has no data for that video","Handle the 404 case gracefully: treat missing dislike data as unknown, not zero","Add backoff/retry for 429/5xx responses","Check RYD service status (returnyoutubedislike.com) if many requests fail at once"],"exampleFix":"// before\nlet v = votes(id).await?; // hard-fails on 404\n// after\nmatch votes(id).await {\n    Ok(v) => Some(v),\n    Err(e) if e.to_string().contains(\"404\") => None, // no RYD data\n    Err(e) => return Err(e),\n}","handlingStrategy":"try-catch","validationCode":"let id_ok = id.len() == 11 && id.chars().all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-');\nif !id_ok { eprintln!(\"malformed videoId, RYD will 404: {}\", id); }","typeGuard":null,"tryCatchPattern":"match ryd::votes(id).await {\n    Ok(v) => Some(v),\n    Err(e) if e.to_string().contains(\"404\") => None, // no RYD data for this video\n    Err(e) if e.to_string().contains(\"429\") => { backoff().await; retry(id).await }\n    Err(e) => return Err(e),\n}","preventionTips":["Treat 404 as 'no dislike data available', not a hard failure","Add exponential backoff for 429/5xx","Cache successful responses to reduce API load","Monitor RYD service health before bulk queries"],"tags":["network","http","return-youtube-dislike","api"],"backgroundTag":"http-error-response","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"}