jackwener/OpenCLI · warning · EmptyResultError
youtube feed
Error message
youtube feed
What it means
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.
Source
Thrown at clis/youtube/feed.js:117
if (videos.length >= limit) break;
const v = extractFromItem(item);
if (v?.video_id) {
videos.push({ rank: videos.length + 1, ...v, url: 'https://www.youtube.com/watch?v=' + v.video_id });
}
}
contItem = newItems[newItems.length - 1];
}
}
return videos;
})()
`);
if (!Array.isArray(data)) {
const errMsg = data && typeof data === 'object' ? String(data.error || '') : '';
throw new CommandExecutionError(errMsg || 'Failed to fetch YouTube feed');
}
if (data.length === 0) {
throw new EmptyResultError('youtube feed');
}
return data;
},
});
View on GitHub (pinned to 49907e53dc)
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.
Defensive patterns
Strategy: fallback
Type guard
function isEmptyFeed(videos) {
return Array.isArray(videos) && videos.length === 0;
} Try / catch
try {
return await yt.feed();
} catch (e) {
if (e instanceof EmptyResultError) {
return []; // treat empty feed as a valid empty state for your app
}
throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/b0f024b95f36772b.
Report an issue: GitHub.