{"record":{"id":"317b3382a172f6f9","repo":"tonhowtf/omniget","slug":"n-o-reconheci-um-v-deo-do-bilibili-em","errorCode":null,"errorMessage":"não reconheci um vídeo do Bilibili em: {}","messagePattern":"não reconheci um vídeo do Bilibili em: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/bilibili/danmaku/export.rs","lineNumber":107,"sourceCode":"    let client = build_client(slug.as_deref())?;\n\n    report(\n        progress,\n        ID,\n        \"progress\",\n        1,\n        Some(4),\n        Some(\"resolvendo o link\".into()),\n    );\n    let mut effective = url.to_string();\n    if url_kind::is_b23_short(&effective) {\n        match url_kind::resolve_b23(&client, &effective).await {\n            Ok(full) => effective = full,\n            Err(e) => return Err(friendly(e, with_account)),\n        }\n    }\n    let kind = url_kind::detect(&effective)\n        .map_err(|_| anyhow!(\"não reconheci um vídeo do Bilibili em: {}\", url))?;\n    let parsed = parser::parse(&client, &kind)\n        .await\n        .map_err(|e| friendly(e, with_account))?;\n\n    let parts = collect_parts(&parsed);\n    if parts.is_empty() {\n        return Err(anyhow!(\n            \"esse link não tem parte de vídeo com comentários — abra uma parte específica\"\n        ));\n    }\n    let wanted = if opts.page > 0 {\n        opts.page\n    } else {\n        page_from_kind(&kind)\n    };\n    let part = pick_part(&parts, wanted).ok_or_else(|| {\n        anyhow!(\n            \"a parte {} não existe; esse vídeo tem {}\",","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/bilibili/danmaku/export.rs#L89-L125","documentation":"After resolving b23.tv short links, run() calls url_kind::detect on the effective URL and throws 'não reconheci um vídeo do Bilibili em: <url>' if the URL doesn't match any known Bilibili video pattern (BV/av id, etc.). The pipeline cannot parse danmaku for an unrecognized URL shape.","triggerScenarios":"Passing a non-video Bilibili URL (user profile, space, live room, article/opus, search page), a URL from another site, or a malformed link that even after b23 expansion doesn't contain a video id.","commonSituations":"User pastes a live-stream link instead of a VOD; copies a share text with extra text; URL from bilibili for a new content type (e.g. /opus) that url_kind::detect doesn't support yet; b23 resolution followed to a login/app redirect page.","solutions":["Paste a canonical video URL containing a BV or av id (e.g. https://www.bilibili.com/video/BV...)","Strip surrounding text/quotes from the pasted link before passing it","If it's a b23 short link, ensure network access so resolve_b23 can expand it before detect","If a valid video URL is still rejected, update url_kind::detect to cover the new URL format"],"exampleFix":"// before\nlet url = \"https://space.bilibili.com/12345\"; // not a video page\nexport::run(&ExportOptions { url: url.into(), ..opts }).await?;\n// after\nlet url = \"https://www.bilibili.com/video/BV1xx411c7mD\";\nanyhow::ensure!(url.contains(\"/video/BV\") || url.contains(\"av\"), \"link precisa ser de um vídeo (BV/av)\");\nexport::run(&ExportOptions { url: url.into(), ..opts }).await?;","handlingStrategy":"validation","validationCode":"fn looks_like_bilibili_video(url: &str) -> bool {\n    let u = url.trim();\n    u.contains(\"bilibili.com/video/\") && (u.contains(\"/BV\") || u.contains(\"?p=\"))\n        || u.contains(\"b23.tv\")\n}","typeGuard":null,"tryCatchPattern":"match export::run(&opts, &progress).await {\n    Err(e) if e.to_string().starts_with(\"não reconheci um vídeo\") => ask_user_for_canonical_video_url(),\n    Err(e) => propagate(e)?,\n    Ok(res) => use_result(res),\n}","preventionTips":["Extract the URL from share text with a regex before passing it in","Reject known non-video Bilibili pages (space, live, opus) in the UI","Keep url_kind::detect patterns updated for new Bilibili URL formats"],"tags":["url","parsing","validation","bilibili"],"backgroundTag":"invalid-url-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"}