{"record":{"id":"eae09ada975ab93e","repo":"tonhowtf/omniget","slug":"n-o-reconheci-esse-canal","errorCode":null,"errorMessage":"não reconheci esse canal: {}","messagePattern":"não reconheci esse canal: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/twitch/emotes.rs","lineNumber":537,"sourceCode":"\nasync fn json_get(http: &reqwest::Client, url: &str) -> anyhow::Result<Value> {\n    let resp = http.get(url).send().await?;\n    if !resp.status().is_success() {\n        anyhow::bail!(\"{} respondeu HTTP {}\", url, resp.status());\n    }\n    Ok(resp.json::<Value>().await?)\n}\n\npub async fn run(opts: &Options, p: &ProgressFn) -> anyhow::Result<Result> {\n    let gql = Gql::new()?;\n    let http = super::super::client()?;\n\n    let login = if opts.channel.trim().is_empty() {\n        None\n    } else {\n        Some(\n            super::gql::parse_channel(&opts.channel)\n                .ok_or_else(|| anyhow!(\"não reconheci esse canal: {}\", opts.channel))?,\n        )\n    };\n\n    report(p, ID, \"progress\", 0, None, Some(\"lendo o canal\".into()));\n    let channel = match &login {\n        Some(l) => Some(gql.channel(l).await?),\n        None => None,\n    };\n    let channel_id = channel.as_ref().map(|c| c.id.clone()).unwrap_or_default();\n    let label = channel\n        .as_ref()\n        .map(|c| c.login.clone())\n        .unwrap_or_else(|| \"global\".to_string());\n\n    let mut items: Vec<Emote> = Vec::new();\n\n    if opts.twitch {\n        if let Some(l) = &login {","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/twitch/emotes.rs#L519-L555","documentation":"run() in the emotes tool parses the channel argument through parse_channel, which extracts a login from a channel URL or plain login. It throws when the given string cannot be recognized as either. The error message includes the raw unrecognized value.","triggerScenarios":"Passing opts.channel with an unexpected format to the emotes download tool (via live_baixa_um_conjunto_pequeno): e.g. a display name with spaces, a URL variant parse_channel does not handle, a full URL with extra path segments, or an empty-after-trim string handled differently.","commonSituations":"Pasting a channel display name instead of the login (e.g. capitalization is fine, but special characters break it); pasting an /about or /videos deep link; pasting the channel's internal numeric id; typos or trailing whitespace/slashes in scripts.","solutions":["Pass the plain login (lowercase, e.g. 'xqc') or a direct channel URL like https://www.twitch.tv/xqc","Trim slashes, query strings, and extra path segments from the channel value","Check the parse_channel implementation for the accepted formats and match one","Leave opts.channel empty if you want global emotes instead of a specific channel"],"exampleFix":"// before\nlet opts = EmoteOpts { channel: \"https://www.twitch.tv/xqc/about\".into(), .. };\n// after\nlet opts = EmoteOpts { channel: \"https://www.twitch.tv/xqc\".into(), .. };","handlingStrategy":"validation","validationCode":"fn is_recognizable_channel(s: &str) -> bool {\n    let t = s.trim().trim_end_matches('/');\n    t.is_empty()\n        || t.parse::<u64>().is_err() // not a numeric user id\n            && t.split('/').last().map_or(false, |l| {\n                !l.is_empty() && l.chars().all(|c| c.is_ascii_alphanumeric() || c == '_')\n            })\n}","typeGuard":null,"tryCatchPattern":"let opts = EmoteOpts { channel: input.clone(), .. };\nif !is_recognizable_channel(&input) {\n    eprintln!(\"'{input}' is not a login or channel URL\");\n    return Ok(());\n}\nmatch run(opts).await {\n    Err(e) if e.to_string().contains(\"não reconheci\") => {\n        eprintln!(\"Unrecognized channel: {input}. Pass a plain login or https://twitch.tv/<login>\");\n    }\n    other => other?,\n}","preventionTips":["Pass the lowercase login or a bare channel URL, not deep links (/about, /videos)","Trim whitespace, slashes and query strings from scripted input","Never pass Twitch numeric user ids — use the login","Leave the field empty intentionally if global emotes are desired"],"tags":["twitch","emotes","argument-parsing","channel"],"backgroundTag":"invalid-argument-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"}