DIYgod / RSSHub

🧡 Everything is RSSible
https://docs.rsshub.app
MIT License
31.78k stars 7.08k forks source link

Lofter tag 路由失效 #15227

Closed JimenezLi closed 4 months ago

JimenezLi commented 4 months ago

路由地址

/lofter/tag/:name?/:type?

完整路由地址

/lofter/tag/neuro

相关文档

https://docs.rsshub.app/zh/routes/social-media#lofter

预期是什么?

Lofter tag 能够正常获取内容

实际发生了什么?

报错 TypeError: Cannot read properties of undefined (reading '2')

部署

RSSHub 演示 (https://rsshub.app)

部署相关信息

OS: Windows, Node: v20.6.1

额外信息

[2024-04-14 22:57:51.353] info: <-- GET /lofter/tag/neuro
[2024-04-14 22:57:51.365] debug: Outgoing request: POST https://www.lofter.com/dwr/call/plaincall/TagBean.getCommonTagExcellentAuthors.dwr
Error: Uncaught [TypeError: dwr.engine._remoteHandleBatchException is not a function]
    at reportException (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\helpers\runtime-script-errors.js:66:24)
    at processJavaScript (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:240:7)
    at HTMLScriptElementImpl._innerEval (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:173:5)
    at D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:114:12
    at ResourceQueue.push (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\browser\resources\resource-queue.js:53:16)
    at HTMLScriptElementImpl._fetchInternalScript (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:113:21)
    at HTMLScriptElementImpl._eval (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:167:12)
    at HTMLScriptElementImpl._poppedOffStackOfOpenElements (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:130:10)
    at JSDOMParse5Adapter.onItemPop (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\browser\parser\html.js:175:43)
    at Parser.onItemPop (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\parser\index.js:158:90)
    at OpenElementStack.pop (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\parser\open-element-stack.js:89:22)
    at endTagInText (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\parser\index.js:2287:20)
    at Parser._endTagOutsideForeignContent (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\parser\index.js:931:17)
    at Parser.onEndTag (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\parser\index.js:897:18)
    at Tokenizer.emitCurrentTagToken (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\tokenizer\index.js:402:26)
    at Tokenizer.handleSpecialEndTag (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\tokenizer\index.js:1151:22)
    at Tokenizer._stateScriptDataEndTagName (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\tokenizer\index.js:1239:18)
    at Tokenizer._stateScriptDataEndTagOpen (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\tokenizer\index.js:1228:18)
    at Tokenizer._callState (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\tokenizer\index.js:621:22)
    at Tokenizer._runParsingLoop (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\tokenizer\index.js:226:22)
    at Tokenizer.write (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\tokenizer\index.js:251:14)
    at Parser.parse (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\parser\index.js:101:26)
    at Object.parse (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\parse5@7.1.2\node_modules\parse5\dist\cjs\index.js:43:30)
    at parseIntoDocument (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\browser\parser\html.js:202:17)
    at parseIntoDocument (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\browser\parser\index.js:31:10)
    at new JSDOM (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\api.js:42:5)
    at Object.handler (d:\SystemDefault\Documents\code\GitProjects\RSSHub\lib\routes\lofter\tag.ts:61:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) TypeError: dwr.engine._remoteHandleBatchException is not a function
    at about:blank:7:28
    at Script.runInContext (node:vm:134:12)
    at Object.runInContext (node:vm:282:6)
    at processJavaScript (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:238:10)
    at HTMLScriptElementImpl._innerEval (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:173:5)
    at D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:114:12
    at ResourceQueue.push (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\browser\resources\resource-queue.js:53:16)
    at HTMLScriptElementImpl._fetchInternalScript (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:113:21)
    at HTMLScriptElementImpl._eval (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:167:12)
    at HTMLScriptElementImpl._poppedOffStackOfOpenElements (D:\SystemDefault\Documents\code\GitProjects\RSSHub\node_modules\.pnpm\jsdom@24.0.0\node_modules\jsdom\lib\jsdom\living\nodes\HTMLScriptElement-impl.js:130:10)

[2024-04-14 22:57:51.536] error: Error in /lofter/tag/neuro: TypeError: TypeError: Cannot read properties of undefined (reading '2')
    at Object.handler (d:\SystemDefault\Documents\code\GitProjects\RSSHub\lib\routes\lofter\tag.ts:72:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at wrapedHandler (d:\SystemDefault\Documents\code\GitProjects\RSSHub\lib\registry.ts:93:33)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at middleware (d:\SystemDefault\Documents\code\GitProjects\RSSHub\lib\middleware\cache.ts:42:9)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at middleware (d:\SystemDefault\Documents\code\GitProjects\RSSHub\lib\middleware\parameter.ts:65:5)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at middleware (d:\SystemDefault\Documents\code\GitProjects\RSSHub\lib\middleware\anti-hotlink.ts:89:5)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at middleware (d:\SystemDefault\Documents\code\GitProjects\RSSHub\lib\middleware\header.ts:26:5)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at middleware (d:\SystemDefault\Documents\code\GitProjects\RSSHub\lib\middleware\template.tsx:15:5)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at middleware (d:\SystemDefault\Documents\code\GitProjects\RSSHub\lib\middleware\debug.ts:16:5)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at middleware (d:\SystemDefault\Documents\code\GitProjects\RSSHub\lib\middleware\access-control.ts:21:9)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at middleware (d:\SystemDefault\Documents\code\GitProjects\RSSHub\lib\middleware\sentry.ts:18:5)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at middleware (d:\SystemDefault\Documents\code\GitProjects\RSSHub\lib\middleware\logger.ts:35:5)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at async compress2 (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/middleware/compress/index.js:5:5)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at async trimTrailingSlash2 (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/middleware/trailing-slash/index.js:4:5)
    at async dispatch (file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/compose.js:29:17)
    at async file:///D:/SystemDefault/Documents/code/GitProjects/RSSHub/node_modules/.pnpm/hono@4.2.3/node_modules/hono/dist/hono-base.js:188:25

这不是重复的 issue

github-actions[bot] commented 4 months ago
Searching for maintainers:

To maintainers: if you are not willing to be disturbed, list your username in scripts/workflow/test-issue/call-maintainer.js. In this way, your username will be wrapped in an inline code block when tagged so you will not be notified.

If all routes can not be found, the issue will be closed automatically. Please use NOROUTE for a route-irrelevant issue or leave a comment if it is a mistake. 如果所有路由都无法匹配,issue 将会被自动关闭。如果 issue 和路由无关,请使用 NOROUTE 关键词,或者留下评论。我们会重新审核。

MorganTwoZero commented 4 months ago

Apparently, it does work if you change the form parameter in the API request to an URL encoded body like this:

body: new URLSearchParams({
    callCount: 1,
    ...
    batchId: 493053,
}),

or:

const body = [
    'callCount=1',
    ...
    'batchId=493053',
];
...
    body: body.join('\r'),

My guess is that something was broken while refactoring utils/got, but I'm not sure what's exactly the problem, so this might not be the best solution. By the way, it seems that the user route also broken in similar way.