{"record":{"id":"78b305bfe7fd4c42","repo":"DIYgod/RSSHub","slug":"pianyuan","errorCode":null,"errorMessage":"pianyuan 搜索失败","messagePattern":"pianyuan 搜索失败","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/pianyuan/search.ts","lineNumber":39,"sourceCode":"    url: 'pianyuan.org/',\n    description: '搜索路由模仿 jackett 的搜索 api, 以提供给 nastools 使用，填写在 nastools 配置 indexer 中',\n};\n\nasync function handler(ctx) {\n    const link_base = 'https://pianyuan.org/';\n    const description = '搜索';\n    // 适配jackett 搜索api, eg: https://rsshub.app/pianyuan/indexers/pianyuan/results/search/api?t=test&q=halo\n    const searchKey = ctx.originalUrl.split('&q=', 2)[1];\n    const link = link_base + `search?q=${searchKey}`;\n\n    const response = await utils.request(link, cache);\n    const $ = load(response.data);\n    // 只获取第一页的搜索结果\n    const searchLinks = $('.nomt > a')\n        .toArray()\n        .map((a) => $(a).attr('href'));\n    if (searchLinks.length === 0) {\n        throw new Error('pianyuan 搜索失败');\n    }\n\n    const detailLinks: Array<string | undefined> = [];\n\n    await Promise.all(\n        searchLinks.map(async (e) => {\n            const link = new URL(e!, link_base).href;\n            const single = await cache.tryGet(link, async (): Promise<any> => {\n                const res = await utils.request(link, cache);\n                const content = load(res.data);\n                detailLinks.push(\n                    ...content('.ico.ico_bt')\n                        .toArray()\n                        .map((a) => $(a).attr('href'))\n                );\n            });\n            return single;\n        })","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/pianyuan/search.ts#L21-L57","documentation":"Error \"pianyuan 搜索失败\" thrown in DIYgod/RSSHub.","triggerScenarios":"The pianyuan search request fails or returns an error response.","commonSituations":"See trigger scenarios.","solutions":["Check the search keyword and retry.","The pianyuan site may be blocking requests; configure the required cookie and retry later."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}