{"record":{"id":"1b56580afc03da09","repo":"garrytan/gstack","slug":"could-not-extract-url-from-filteredargs-0-t","errorCode":null,"errorMessage":"Could not extract URL from ${filteredArgs[0]} (${tagName})","messagePattern":"Could not extract URL from (.+?) \\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/write-commands.ts","lineNumber":1172,"sourceCode":"      if (url.startsWith('@')) {\n        const resolved = await bm.resolveRef(url);\n        if (!('locator' in resolved)) throw new Error(`Expected @ref, got CSS selector: ${url}`);\n        const locator = resolved.locator;\n        const tagName = await locator.evaluate(el => el.tagName.toLowerCase());\n        if (tagName === 'img') {\n          url = await locator.evaluate(el => {\n            const img = el as HTMLImageElement;\n            return img.currentSrc || img.src || img.getAttribute('data-src') || '';\n          });\n        } else if (tagName === 'video') {\n          url = await locator.evaluate(el => (el as HTMLVideoElement).currentSrc || (el as HTMLVideoElement).src || '');\n        } else if (tagName === 'audio') {\n          url = await locator.evaluate(el => (el as HTMLAudioElement).currentSrc || (el as HTMLAudioElement).src || '');\n        } else {\n          // Try src attribute on any element\n          url = await locator.evaluate(el => el.getAttribute('src') || '');\n        }\n        if (!url) throw new Error(`Could not extract URL from ${filteredArgs[0]} (${tagName})`);\n      }\n\n      // Check for HLS/DASH\n      if (url.includes('.m3u8') || url.includes('.mpd')) {\n        throw new Error('This is an HLS/DASH stream. Use yt-dlp or ffmpeg for adaptive stream downloads.');\n      }\n\n      // Determine output path and extension\n      const page = bm.getPage();\n      let contentType = 'application/octet-stream';\n      let buffer: Buffer;\n\n      if (url.startsWith('blob:')) {\n        // Strategy 3: Blob URL -- in-page fetch + base64\n        const dataUrl = await page.evaluate(async (blobUrl) => {\n          try {\n            const resp = await fetch(blobUrl);\n            const blob = await resp.blob();","sourceCodeStart":1154,"sourceCodeEnd":1190,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/write-commands.ts#L1154-L1190","documentation":"Error \"Could not extract URL from ${filteredArgs[0]} (${tagName})\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/write-commands.ts:1172 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}