{"record":{"id":"4813239659ea4cd6","repo":"DIYgod/RSSHub","slug":"error-481323","errorCode":null,"errorMessage":"无法获取用户信息","messagePattern":"无法获取用户信息","errorType":"exception","errorClass":"RejectError","httpStatus":null,"severity":"error","filePath":"lib/routes/toutiao/user.tsx","lineNumber":61,"sourceCode":"        `toutiao:user:${token}`,\n        async () => {\n            const query = `category=profile_all&token=${token}&max_behot_time=0&entrance_gid&aid=24&app_name=toutiao_web`;\n\n            const headers = generateHeaders(PRESETS.MODERN_WINDOWS_CHROME);\n            const userAgent = headers['user-agent'];\n\n            const data = await ofetch(`https://www.toutiao.com/api/pc/list/feed?${query}&a_bogus=${generate_a_bogus(query, userAgent)}`, {\n                headerGeneratorOptions: PRESETS.MODERN_WINDOWS_CHROME,\n            });\n\n            return data.data;\n        },\n        config.cache.routeExpire,\n        false\n    )) as Feed[];\n\n    if (!feed) {\n        throw new RejectError('无法获取用户信息');\n    }\n\n    const items = feed.map((item) => {\n        switch (item.cell_type) {\n            case 0:\n            case 49: {\n                const video = item.video.play_addr_list.toSorted((a, b) => b.bitrate - a.bitrate)[0];\n                const user = item.user as UserInfoCell49 | undefined;\n                return {\n                    title: item.title,\n                    description: renderVideo(item.video.play_addr_list.toSorted((a, b) => b.bitrate - a.bitrate)[0].play_url_list[0], item.video.origin_cover.url_list[0]),\n                    link: `https://www.toutiao.com/video/${item.id}/`,\n                    pubDate: parseDate(item.publish_time, 'X'),\n                    author: user?.info.name ?? item.source,\n                    enclosure_url: video?.play_url_list[0],\n                    enclosure_type: video?.play_url_list[0] ? 'video/mp4' : undefined,\n                    user: {\n                        name: user?.info.name,","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/toutiao/user.tsx#L43-L79","documentation":"A `RejectError` thrown at lib/routes/toutiao/user.tsx:61 when Toutiao's feed API (`/api/pc/list/feed`) returned no usable `data.data` array. Toutiao employs aggressive anti-crawler protection via the `a_bogus` signature parameter; if the signature is stale, the token is invalid, or the IP is flagged, the API returns an anti-bot response with no feed items. The route is marked `antiCrawler: true`.","triggerScenarios":"The `generate_a_bogus` function in ./a-bogus is outdated and Toutiao's algorithm changed; the user token (`MS4wLjAB...`) is invalid or the account is banned; the requesting IP is rate-limited or geo-blocked; the ofetch call was intercepted by a Cloudflare/Toutiao challenge page that returns HTML instead of JSON.","commonSituations":"Toutiao rotates the a_bogus algorithm periodically, breaking the route; self-hosted RSSHub on a datacenter IP gets flagged; token copied from an expired session.","solutions":["Update the `generate_a_bogus` implementation in lib/routes/toutiao/a-bogus to match Toutiao's current JS algorithm (capture a live request and diff).","Verify the token by opening `https://www.toutiao.com/c/user/token/{token}/` in a browser.","Run RSSHub from a residential IP or use a proxy to avoid bot-detection flagging.","Clear cache key `toutiao:user:{token}` to force a fresh signed request."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"const isFeedArray = (d: unknown): d is Feed[] =>\n    Array.isArray(d) && d.length > 0;","tryCatchPattern":"try {\n    const feed = await getToutiaoFeed(token);\n} catch (e) {\n    if (e instanceof RejectError) {\n        // a_bogus signature likely stale or IP flagged — retry after updating algorithm\n        throw new Error('Toutiao anti-crawler blocked the request; update a_bogus or rotate IP');\n    }\n    throw e;\n}","preventionTips":["Keep generate_a_bogus in lib/routes/toutiao/a-bogus synchronized with Toutiao's current JS obfuscation — capture a live request periodically.","Run RSSHub from a residential IP; datacenter IPs are frequently flagged by Toutiao.","Verify the user token is valid by opening the Toutiao profile page in a browser.","Cache feed results (routeExpire) to reduce the frequency of signed requests and lower detection risk."],"tags":["anti-crawler","authentication","api","network","toutiao"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}