{"record":{"id":"07910499e3e977de","repo":"tonhowtf/omniget","slug":"no-media-found-in-post","errorCode":null,"errorMessage":"No media found in post","messagePattern":"No media found in post","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/instagram.rs","lineNumber":547,"sourceCode":"                }\n            }\n        }\n\n        if let Some(video_url) = data.get(\"video_url\").and_then(|v| v.as_str()) {\n            return Ok(InstagramMedia::Single {\n                url: video_url.to_string(),\n                is_video: true,\n            });\n        }\n\n        if let Some(display_url) = data.get(\"display_url\").and_then(|v| v.as_str()) {\n            return Ok(InstagramMedia::Single {\n                url: display_url.to_string(),\n                is_video: false,\n            });\n        }\n\n        Err(anyhow!(\"No media found in post\"))\n    }\n\n    fn instagram_headers() -> reqwest::header::HeaderMap {\n        let mut headers = reqwest::header::HeaderMap::new();\n        headers.insert(\n            reqwest::header::REFERER,\n            \"https://www.instagram.com/\".parse().unwrap(),\n        );\n        headers.insert(\n            reqwest::header::ORIGIN,\n            \"https://www.instagram.com\".parse().unwrap(),\n        );\n        headers\n    }\n\n    fn post_url_from_title(title: &str) -> Option<String> {\n        let post_id = title.strip_prefix(\"instagram_\")?;\n        if post_id.is_empty() {","sourceCodeStart":529,"sourceCodeEnd":565,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/instagram.rs#L529-L565","documentation":"extract_media_from_gql walks a successfully fetched GQL media node looking, in order, for edge_sidecar_to_children (carousel), video_url, and display_url. This error is thrown when the media node exists but none of those fields yield a usable URL — the JSON shape is recognized as a post but contains no downloadable media.","triggerScenarios":"A GQL xdt_shortcode_media node that has no edge_sidecar_to_children.edges with resolvable node.video_url/display_url, no top-level video_url, and no top-level display_url — e.g. a media node returned in a degraded/error state, or an unsupported media type.","commonSituations":"See trigger scenarios.","solutions":["Dump the media node JSON when this fires and add handling for any new field names (Instagram occasionally renames display_url/video_url).","Check whether the node has an edge_media_to_caption/owner but no media fields, which indicates an auth-stripped response — consider supplying cookies.","Ensure carousel edges with missing video_url/display_url don't silently empty the items vec; log filtered-out edges.","Fall back to the embed extractor or fallback_ytdlp for posts the GQL parser can't handle."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Rust: verify the GQL node carries at least one known media field\nfn gql_node_has_media(node: &serde_json::Value) -> bool {\n    node.get(\"edge_sidecar_to_children\").is_some()\n        || node.get(\"video_url\").is_some()\n        || node.get(\"display_url\").is_some()\n}","typeGuard":"fn as_media_url(v: &serde_json::Value) -> Option<&str> {\n    v.as_str().filter(|s| s.starts_with(\"http\"))\n}","tryCatchPattern":"match extract_media_from_gql(&node) {\n    Ok(media) => media,\n    Err(e) if e.to_string().contains(\"No media found in post\") => {\n        // node shape unrecognized; try embed extraction or yt-dlp\n        fallback_extract(url).await\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Log the full media node when extraction fails to catch schema drift","Treat missing display_url/video_url as a signal of auth-stripped responses","Filter carousel edges defensively and log skipped nodes","Keep an independent extractor (yt-dlp) as backup"],"tags":["instagram","json-parsing","schema-change"],"backgroundTag":"unexpected-response-shape","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"}