{"record":{"id":"ed7d7b09bfe50d59","repo":"DIYgod/RSSHub","slug":"youtube-rss-is-disabled-due-to-the-lack-of-a-href","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/custom.ts","lineNumber":43,"sourceCode":"        antiCrawler: false,\n        supportBT: false,\n        supportPodcast: false,\n        supportScihub: false,\n    },\n    radar: [\n        {\n            source: ['www.youtube.com/c/:id'],\n            target: '/c/:id',\n        },\n    ],\n    name: 'Custom URL',\n    maintainers: ['TonyRL'],\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    const { data: response } = await got(`https://www.youtube.com/c/${username}`);\n    const $ = load(response);\n    const ytInitialData = JSON.parse(\n        $('script')\n            .text()\n            .match(/ytInitialData = (\\{.*?\\});/)?.[1] || '{}'\n    );\n    const externalId = ytInitialData.metadata.channelMetadataRenderer.externalId;\n    const playlistId = (await getChannelWithId(externalId, 'contentDetails', cache)).data.items[0].contentDetails.relatedPlaylists.uploads;\n\n    const data = (await getPlaylistItems(playlistId, 'snippet', cache)).data.items;\n\n    return {\n        title: `${username} - YouTube`,","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/youtube/custom.ts#L25-L61","documentation":"ConfigNotFoundError thrown by the YouTube custom-URL handler when config.youtube is falsy or config.youtube.key is empty. The route resolves a /c/<slug> URL to a channel id via scraping, but the downstream pipeline still needs a YouTube Data API key, so the handler refuses to start without one. The message links to the route-specific config docs.","triggerScenarios":"Any request to /youtube/c/:username when YOUTUBE_KEY is not configured on the RSSHub instance. The guard `if (!config.youtube || !config.youtube.key)` fires at the top of the handler before any network call.","commonSituations":"Self-hosted RSSHub without a Google API key; the operator wants only the no-key youtubei routes but tried a /c/ route that still gates on the key; key env var typo'd as YOUTUBE_KEYS or similar.","solutions":["Create a YouTube Data API v3 key in Google Cloud Console and set YOUTUBE_KEY (comma-separated for multiple keys).","Restart RSSHub so config picks up the new env var.","If you cannot obtain a key, use a route that does not require it (e.g. the youtubei-backed /youtube/user/:id)."],"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. See https://docs.rsshub.app/deploy/config#route-specific-configurations');\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create a YouTube Data API v3 key in Google Cloud and set YOUTUBE_KEY before using /c/ routes.","Restart RSSHub after setting env vars.","If you cannot get a key, prefer youtubei-backed routes that do not require one."],"tags":["youtube","config","api-key","google-api"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}