{"record":{"id":"f425d3b163eda5b0","repo":"hmjz100/LinkSwift","slug":"br-f425d3","errorCode":null,"errorMessage":"提示：<br/>页面错误~","messagePattern":"提示：<br/>页面错误~","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"（改）网盘直链下载助手.user.js","lineNumber":6121,"sourceCode":"\t\t\t\tfiles = await this.getFilesUrl(files, token).catch(e => {\r\n\t\t\t\t\tif (e instanceof Error) throw e;\r\n\t\t\t\t\tthrow new Error(e?.message || e || \"[百度网盘] 获取文件 URL 失败\");\r\n\t\t\t\t});\r\n\t\t\t} else if (temp.page === \"share\") {\r\n\t\t\t\tconst shareData = await this.getShareData();\r\n\r\n\t\t\t\tconst sign = await base.get(`${config.$baidu.api.getShareSign}&surl=1${shareData.share.url}$bdstoken=${shareData.baidu.token}&logid=${base.encodeBase(shareData.baidu.id)}`);\r\n\t\t\t\tif (sign?.data?.sign && sign?.data?.timestamp) {\r\n\t\t\t\t\tshareData.sign = sign.data.sign;\r\n\t\t\t\t\tshareData.timestamp = sign.data.timestamp;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfiles = await this.getShareFilesUrl(files, shareData, token).catch(e => {\r\n\t\t\t\t\tif (e instanceof Error) throw e;\r\n\t\t\t\t\tthrow new Error(e?.message || e || \"[百度网盘] 获取分享文件 URL 失败\");\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(\"提示：<br/>页面错误~\");\r\n\t\t\t}\r\n\r\n\t\t\ttemp.links = [files, {\r\n\t\t\t\tisFolder: v => v.isdir === 1,\r\n\t\t\t\tgetFileName: v => (v.server_filename || v.filename),\r\n\t\t\t\tgetFileSize: v => v.size,\r\n\t\t\t\tgetFileLink: v => {\r\n\t\t\t\t\tif (!v.dlink || !v.dlink.startsWith(\"http\")) return v.dlink;\r\n\t\t\t\t\tconst url = new URL(v.dlink);\r\n\t\t\t\t\turl.searchParams.set(\"access_token\", token);\r\n\t\t\t\t\treturn url.href;\r\n\t\t\t\t},\r\n\t\t\t\tconvert: {\r\n\t\t\t\t\taria2: `--header \"User-Agent:${config.$baidu.api.ua.downloadLink}\"`,\r\n\t\t\t\t\tcurl: `-A \"${config.$baidu.api.ua.downloadLink}\"`,\r\n\t\t\t\t\tbitcomet: `user_agent=${encodeURIComponent(config.$baidu.api.ua.downloadLink)}`\r\n\t\t\t\t},\r\n\t\t\t\ttooltip: config.$baidu.dom\r","sourceCodeStart":6103,"sourceCodeEnd":6139,"githubUrl":"https://github.com/hmjz100/LinkSwift/blob/417ea5e28a3e1a90339710e17356e9fd22b8a34b/（改）网盘直链下载助手.user.js#L6103-L6139","documentation":"Terminal else-branch of the Baidu flow: thrown when `temp.page` is neither 'home'/'main' nor 'share', so the script has no download strategy for the current page. temp.page is set by the script's route/page detection on the Netdisk site.","triggerScenarios":"The userscript is invoked on a Baidu Netdisk URL the page-detection logic doesn't classify — e.g. new Netdisk frontend routes, album/note/other special pages, or a redesigned URL scheme that page detection no longer recognizes.","commonSituations":"Baidu Netdisk redesign introducing new routes the userscript hasn't mapped; opening the download popup from an unusual entry point (mobile web layout, enterprise/new-version Netdisk); page detection state corrupted after SPA navigation without reload.","solutions":["Navigate to the standard file-list page (home/main) or the share page and retry.","Hard-refresh the page so the script re-runs page detection and sets temp.page correctly.","Update the userscript to a version supporting the current Netdisk URL scheme."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const ok = ['home', 'main', 'share'].includes(temp.page);\nif (!ok) { alert('请在网盘文件列表页或分享页使用本脚本'); return; }","typeGuard":"const isSupportedPage = (p) => p === 'home' || p === 'main' || p === 'share';","tryCatchPattern":"try { await getLinks(); } catch (e) { if (String(e.message).includes('页面错误')) { location.reload(); return; } throw e; }","preventionTips":["Use the script only on standard file-list or share pages","Hard-refresh after SPA navigation so page detection re-runs","Update the userscript when the Netdisk frontend introduces new routes"],"tags":["userscript","baidu-netdisk","page-detection","unsupported-page"],"backgroundTag":"unsupported-page-context","analyzedSha":"417ea5e28a3e1a90339710e17356e9fd22b8a34b","analyzedAt":"2026-09-02T18:13:32.837Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}