{"record":{"id":"b0f024b95f36772b","repo":"jackwener/OpenCLI","slug":"youtube-feed","errorCode":null,"errorMessage":"youtube feed","messagePattern":"youtube feed","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/youtube/feed.js","lineNumber":117,"sourceCode":"              if (videos.length >= limit) break;\n              const v = extractFromItem(item);\n              if (v?.video_id) {\n                videos.push({ rank: videos.length + 1, ...v, url: 'https://www.youtube.com/watch?v=' + v.video_id });\n              }\n            }\n            contItem = newItems[newItems.length - 1];\n          }\n        }\n\n        return videos;\n      })()\n    `);\n        if (!Array.isArray(data)) {\n            const errMsg = data && typeof data === 'object' ? String(data.error || '') : '';\n            throw new CommandExecutionError(errMsg || 'Failed to fetch YouTube feed');\n        }\n        if (data.length === 0) {\n            throw new EmptyResultError('youtube feed');\n        }\n        return data;\n    },\n});\n","sourceCodeStart":99,"sourceCodeEnd":122,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/youtube/feed.js#L99-L122","documentation":"EmptyResultError thrown by `youtube feed` when the page script succeeded and returned an array, but it contained zero items. The library treats an empty home feed as an exceptional condition rather than a valid empty result, signaling that no feed videos were extracted.","triggerScenarios":"Calling `youtube feed` on a fresh/freshly-logged-in account with no watch signals, a page rendered without feed sections at scrape time, or region/consent settings that suppress the feed grid while selectors still technically match.","commonSituations":"Brand-new Google account with an empty home feed; feed delayed by slow loading so the extractor snapshot ran too early; restricted/child accounts or EU consent walls hiding recommendations; VPN/region making the feed empty.","solutions":["Scroll/interact on youtube.com first so the account has feed content, then re-run.","Wait and retry — the extractor may have snapshotted before the feed rendered.","Check account type/region restrictions (child accounts, consent walls).","If the account clearly has a feed but the command returns empty, report a selector regression in the library."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":"function isEmptyFeed(videos) {\n  return Array.isArray(videos) && videos.length === 0;\n}","tryCatchPattern":"try {\n  return await yt.feed();\n} catch (e) {\n  if (e instanceof EmptyResultError) {\n    return []; // treat empty feed as a valid empty state for your app\n  }\n  throw e;\n}","preventionTips":["Use accounts with watch activity so the feed has content.","Bypass consent/region walls that suppress the feed.","Retry after a short wait if the feed may not have rendered yet.","Only treat this as a bug if youtube.com visibly shows feed items."],"tags":["youtube","feed","empty-result","scraping"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}