ITADN

[Bug] YouTube routes return 503 due to LockupView format change in youtubei.js API responses

#22658Closedsilvermissile 创建于 2026-07-10
S
silvermissilecommented
### Routes /youtube/user/@handle /youtube/channel/:id ### Expected behavior YouTube user and channel routes should return valid RSS feeds with video items. ### Actual behavior All YouTube routes that use the youtubei.js fallback API (i.e., without `YOUTUBE_KEY`) return HTTP 503 with "this route is empty" error. ### Root Cause Analysis YouTube's internal API has changed the response format for channel video listings. The `getVideos()` call on a channel object now returns **`LockupView`** objects instead of the previously expected `Video`/`GridVideo` objects. Key differences: | Property | Legacy (Video/GridVideo) | New (LockupView) | |----------|-------------------------|-------------------| | Video ID | `video.video_id` | `video.content_id` | | Title | `video.title.text` | `video.metadata.title.text` | | Thumbnail | `video.best_thumbnail.url` | `video.content_image.image[0].url` | | Publish date | `video.published.text` | `video.metadata.metadata.metadata_rows[].metadata_parts[].text.text` | | Duration | `video.duration.seconds` | Parsed from `video.content_image.overlays[].badges[].text` (e.g. "3:22") | The existing code in `lib/routes/youtube/api/youtubei.ts` filters with `.filter((video) => 'video_id' in video)`, which now filters out **all** videos since LockupView objects only have `content_id`. ### Environment - RSSHub Git Hash: `6d77bd84` - Node Version: `v24.18.0` - youtubei.js Version: `17.2.0` - Tested on self-hosted instance (Alibaba Cloud HK) ### Reproduction 1. Deploy latest RSSHub without `YOUTUBE_KEY` 2. Request any YouTube user route, e.g. `/youtube/user/@JFlaMusic` 3. Observe 503 response with "this route is empty" Debug verification from within the container: ```javascript const { Innertube } = require("youtubei.js"); const yt = await Innertube.create(); const channel = await yt.getChannel("UClkRzsdvg7_RKVhwDwiDZOA"); const videos = await channel.getVideos(); console.log(videos.videos[0].type); // "LockupView" (was "Video") console.log(videos.videos[0].content_id); // "iFDpCiaaY2Q" (video_id is undefined) ``` ### Related Issues - #22166 - Same symptoms, was auto-closed without fix - #21961 - Same error message, closed suggesting YOUTUBE_KEY is required
关闭于 2026-07-10 2 条评论