{"record":{"id":"1240ca83227c8eb8","repo":"tonhowtf/omniget","slug":"no-gallery-url-available","errorCode":null,"errorMessage":"No gallery URL available","messagePattern":"No gallery URL available","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/gallerydl/mod.rs","lineNumber":198,"sourceCode":"                url: url.to_string(),\n                format: \"gallery\".to_string(),\n            }],\n            media_type: MediaType::Carousel,\n            file_size_bytes: None,\n        })\n    }\n\n    async fn download(\n        &self,\n        info: &MediaInfo,\n        opts: &DownloadOptions,\n        progress: mpsc::Sender<ProgressUpdate>,\n    ) -> anyhow::Result<DownloadResult> {\n        let url = info\n            .available_qualities\n            .first()\n            .map(|q| q.url.clone())\n            .ok_or_else(|| anyhow!(\"No gallery URL available\"))?;\n\n        let bin = omniget_core::core::dependencies::ensure_gallerydl()\n            .await\n            .ok_or_else(|| {\n                anyhow!(\n                    \"gallery-dl is not available. Install gallery-dl to download from this site.\"\n                )\n            })?;\n\n        std::fs::create_dir_all(&opts.output_dir)?;\n        let _ = progress.send(ProgressUpdate::percent(-2.0)).await;\n\n        let mut cmd = omniget_core::core::process::command(&bin);\n        cmd.arg(\"--no-colors\")\n            .arg(\"-D\")\n            .arg(&opts.output_dir)\n            .stdout(Stdio::piped())\n            .stderr(Stdio::piped());","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/gallerydl/mod.rs#L180-L216","documentation":"gallery-dl-based `download` extracts the gallery URL from the first entry of `available_qualities` and errors when the list is empty. The gallery-dl binary needs a target URL, so without one the download cannot start.","triggerScenarios":"Calling gallerydl `download` with MediaInfo whose `available_qualities` vec is empty — i.e. the gallery info step produced no URL entries.","commonSituations":"Gallery resolution succeeded partially (metadata found but no URL captured), unsupported gallery sites where URL extraction yields nothing, or stale MediaInfo reused after the original gallery page changed.","solutions":["Re-run gallery info extraction to repopulate available_qualities before downloading.","Verify the gallery URL extraction covers the specific site supported by gallery-dl.","If the info step cannot populate URLs, construct MediaInfo directly from the user-supplied gallery URL.","Update gallery-dl (`gallery-dl -U` or re-fetch) if site changes break extraction and leave the list empty."],"exampleFix":"// before\nlet url = info.available_qualities.first().map(|q| q.url.clone()).ok_or_else(|| anyhow!(\"No gallery URL available\"))?;\n// after\nlet url = info\n    .available_qualities\n    .first()\n    .map(|q| q.url.clone())\n    .or_else(|| info.source_url.clone())\n    .ok_or_else(|| anyhow!(\"No gallery URL available (qualities empty)\"))?;","handlingStrategy":"validation","validationCode":"// Rust, before calling download\nif info.available_qualities.iter().all(|q| q.url.is_empty()) {\n    return Err(anyhow!(\"Gallery info carries no URL; re-extract gallery info\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure the gallery info extraction step always populates at least the original gallery URL.","Fall back to the user-supplied gallery URL when qualities extraction yields nothing.","Keep gallery-dl updated so site changes do not silently produce empty URL lists."],"tags":["downloader","gallery-dl","empty-list","url"],"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"}