{"record":{"id":"43458be48a52be25","repo":"DIYgod/RSSHub","slug":"youtube-rss-is-disabled-due-to-the-lack-of-a-href-43458b","errorCode":null,"errorMessage":"YouTube RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>","messagePattern":"YouTube RSS is disabled due to the lack of <a href=\"https://docs\\.rsshub\\.app/deploy/config#route-specific-configurations\">relevant config</a>","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/youtube/live.ts","lineNumber":38,"sourceCode":"                name: 'YOUTUBE_KEY',\n                description:\n                    'YouTube API Key (enable YouTube Data API v3), support multiple keys, split them with `,`, [API Key application](https://console.developers.google.com/), [YouTube Data API v3](https://console.cloud.google.com/apis/library/youtube.googleapis.com)',\n            },\n        ],\n        requirePuppeteer: false,\n        antiCrawler: false,\n        supportBT: false,\n        supportPodcast: false,\n        supportScihub: false,\n    },\n    name: 'Live',\n    maintainers: ['sussurr127'],\n    handler,\n};\n\nasync function handler(ctx) {\n    if (!config.youtube || !config.youtube.key) {\n        throw new ConfigNotFoundError('YouTube RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>');\n    }\n    const username = ctx.req.param('username');\n    const embed = !ctx.req.param('embed');\n\n    let channelName;\n    let channelId;\n\n    const link = `https://www.youtube.com/${username}`;\n    const response = await got(link);\n    const $ = load(response.data);\n    channelId = $('meta[itemprop=\"identifier\"]').attr('content');\n    channelName = $('meta[itemprop=\"name\"]').attr('content');\n\n    if (!channelId) {\n        const channelInfo = (await getChannelWithUsername(username, 'snippet', cache)).data.items[0];\n        channelId = channelInfo.id;\n        channelName = channelInfo.snippet.title;\n    }","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/youtube/live.ts#L20-L56","documentation":"ConfigNotFoundError thrown by the YouTube live handler when config.youtube or config.youtube.key is missing. Like /c/, the live route depends on the YouTube Data API key to resolve channel/live data, so it aborts immediately if the key is absent.","triggerScenarios":"Any request to /youtube/live/:username (or the live route) when YOUTUBE_KEY is unset. The guard fires before the got() to youtube.com.","commonSituations":"Same as 657: self-hosted instance without YOUTUBE_KEY; env var not passed to the container; key removed.","solutions":["Set YOUTUBE_KEY to a valid YouTube Data API v3 key and restart RSSHub.","Confirm the key has the YouTube Data API v3 enabled and quota available.","Use a keyless alternative route if you cannot configure one."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { config } from '@/config';\nfunction requireYouTubeKey() {\n    if (!config.youtube || !config.youtube.key) {\n        throw new ConfigNotFoundError('Set the YOUTUBE_KEY env var to a YouTube Data API v3 key.');\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure YOUTUBE_KEY to use the live route.","Ensure the API key has YouTube Data API v3 enabled with available quota.","Restart RSSHub after env changes."],"tags":["youtube","config","api-key","google-api","live"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}