{"record":{"id":"2a2331cdb344e555","repo":"jackwener/OpenCLI","slug":"youtube-history","errorCode":null,"errorMessage":"youtube history","messagePattern":"youtube history","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/youtube/history.js","lineNumber":265,"sourceCode":"          requestBody = { continuation: nextCursor };\n        }\n\n        return {\n          error: 'page-cap',\n          message: 'YouTube history pagination stopped before satisfying the requested limit',\n        };\n      })()\n    `);\n\n        if (Array.isArray(result)) return result;\n        if (result?.error === 'auth') {\n            throw new AuthRequiredError('www.youtube.com', result.message || 'Not logged in to YouTube');\n        }\n        if (result?.error === 'timeout') {\n            throw new TimeoutError('YouTube history request', REQUEST_TIMEOUT_SECONDS);\n        }\n        if (result?.error === 'empty') {\n            throw new EmptyResultError('youtube history', result.message || 'No watch history items found');\n        }\n        throw new CommandExecutionError(result?.message || 'Failed to fetch YouTube history');\n    },\n});\n","sourceCodeStart":247,"sourceCodeEnd":270,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/youtube/history.js#L247-L270","documentation":"EmptyResultError thrown by `youtube history` when the in-page script reports error === 'empty' (or an explicit empty payload with a message). The scrape succeeded but zero watch-history items were found, which the library surfaces as an error because history being empty is usually unexpected.","triggerScenarios":"YouTube account with watch history paused or cleared, a brand-new account with no watched videos, history disabled via 'Pause watch history', or the FEhistory payload returning no items despite a valid session.","commonSituations":"Users who turned off watch history for privacy; freshly created Google accounts; history auto-deleted (auto-delete set to 3 months and no recent activity); managed/child accounts with history disabled by policy.","solutions":["Confirm watch history is enabled: YouTube → Settings → History & privacy → ensure 'Pause watch history' is off.","Watch a video or two, then re-run to populate history.","Check auto-delete settings that may have purged all items.","If history is visibly non-empty on youtube.com but the command returns empty, report a possible extractor regression."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return await yt.history({ limit });\n} catch (e) {\n  if (e instanceof EmptyResultError) {\n    return []; // account genuinely has no watch history\n  }\n  throw e;\n}","preventionTips":["Ensure 'Pause watch history' is off in YouTube settings.","Watch some videos before scraping a new account.","Check auto-delete history settings that may purge items.","Treat empty as a normal state for privacy-conscious accounts."],"tags":["youtube","empty-result","history","scraping"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}