{"record":{"id":"c67de810a7f820e3","repo":"tonhowtf/omniget","slug":"nao-achei-os-bundles-js-do-x-na-pagina","errorCode":null,"errorMessage":"nao achei os bundles JS do X na pagina","messagePattern":"nao achei os bundles JS do X na pagina","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/x/query_ids.rs","lineNumber":209,"sourceCode":"                    if let Some(next) = text\n                        .split(\"document.location = \\\"\")\n                        .nth(1)\n                        .and_then(|s| s.split('\"').next())\n                    {\n                        if let Ok(r2) = http.get(next).send().await {\n                            if let Ok(t2) = r2.text().await {\n                                html.push_str(&t2);\n                            }\n                        }\n                    }\n                }\n                html.push_str(&text);\n            }\n        }\n    }\n    let urls = script_urls(&html);\n    if urls.is_empty() {\n        anyhow::bail!(\"nao achei os bundles JS do X na pagina\");\n    }\n    let mut found: HashMap<String, String> = HashMap::new();\n    let sem = std::sync::Arc::new(tokio::sync::Semaphore::new(8));\n    let mut tasks = Vec::new();\n    for url in urls.into_iter().take(60) {\n        let http = http.clone();\n        let sem = sem.clone();\n        tasks.push(tokio::spawn(async move {\n            let _p = sem.acquire().await.ok()?;\n            let resp = http.get(&url).send().await.ok()?;\n            if !resp.status().is_success() {\n                return None;\n            }\n            let text = resp.text().await.ok()?;\n            Some(extract_ops(&text))\n        }));\n    }\n    for t in tasks {","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/x/query_ids.rs#L191-L227","documentation":"refresh() in query_ids.rs fetches the X (Twitter) web page HTML, extracts <script> bundle URLs, and bails if none are found. This means the fetched page contained no JS bundle references, so GraphQL operation IDs cannot be discovered.","triggerScenarios":"Calling refresh() when the fetched HTML has zero script URLs — typically because X returned a block page, consent/challenge page, or an empty/error response instead of the normal app shell.","commonSituations":"IP rate-limited or blocked by X; guest access serving a simplified page; X changed its page markup so script_urls() regex no longer matches; proxy returning an error page.","solutions":["Log/inspect the returned HTML to see what page X actually served (block page vs. changed markup).","Retry with an authenticated session or different IP/proxy to get the real app shell.","Update the script_urls() extraction regex to match the current X page markup.","Use a cached copy of the query-id mapping until refresh can succeed."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match refresh().await {\n    Ok(ids) => ids,\n    Err(e) if e.to_string().contains(\"bundles JS\") => {\n        // fall back to cached ids and log for diagnosis\n        load()\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep a last-known-good cached mapping of GraphQL operation IDs.","Monitor page fetches for block/challenge responses and back off with proxy rotation.","Alert when refresh fails repeatedly — it usually means X changed markup or blocked you."],"tags":["scraping","network","html-parsing"],"backgroundTag":"empty-result-set","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"}