{"record":{"id":"ece68040af68e1de","repo":"lyswhut/lx-music-desktop","slug":"error-ece680","errorCode":null,"errorMessage":"获取热搜词失败","messagePattern":"获取热搜词失败","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/renderer/utils/musicSdk/tx/hotSearch.js","lineNumber":47,"sourceCode":"          uin: '0',\n          wid: '0',\n        },\n        hotkey: {\n          method: 'GetHotkeyForQQMusicPC',\n          module: 'tencent_musicsoso_hotkey.HotkeyService',\n          param: {\n            search_id: '',\n            uin: 0,\n          },\n        },\n      },\n      headers: {\n        Referer: 'https://y.qq.com/portal/player.html',\n      },\n    })\n    const { body, statusCode } = await _requestObj.promise\n    // console.log(body)\n    if (statusCode != 200 || body.code !== 0) throw new Error('获取热搜词失败')\n    // console.log(body)\n    return { source: 'tx', list: this.filterList(body.hotkey.data.vec_hotkey) }\n  },\n  filterList(rawList) {\n    return rawList.map(item => item.query)\n  },\n}\n","sourceCodeStart":29,"sourceCodeEnd":55,"githubUrl":"https://github.com/lyswhut/lx-music-desktop/blob/9c364b482e5621a1d38b50e8610d2fb974457e6e/src/renderer/utils/musicSdk/tx/hotSearch.js#L29-L55","documentation":"Thrown by QQ Music's hotSearch.getList when the musicu.fcg endpoint at https://u.y.qq.com/cgi-bin/musicu.fcg returns non-200 or body.code !== 0. Uses POST with a JSON body (module: tencent_musicsoso_hotkey.HotkeyService, method: GetHotkeyForQQMusicPC). Has a retry guard (retryNum > 2) that fires first. Only checks body.code (not a nested req.code), unlike error 51 which uses the same endpoint. Reads body.hotkey.data.vec_hotkey.","triggerScenarios":"Calling getList() when Tencent changes the HotkeyService module path or method name. Anti-bot detection blocks the request. The Referer header (https://y.qq.com/portal/player.html) is outdated. body.code is non-zero for rate-limited or geo-blocked requests.","commonSituations":"Tencent updates its internal module/method naming between versions. The fixed Referer URL becomes stale when QQ Music's portal page changes. ISP-level interference with u.y.qq.com.","solutions":["Log body and statusCode to see the error code and message.","Inspect current y.qq.com network requests to update the module/method/Referer strings.","Retry by calling getList(retryNum + 1) since it supports bounded retries.","Fall back to another provider's hot search if QQ Music is unavailable."],"exampleFix":"// before\nif (statusCode != 200 || body.code !== 0) throw new Error('获取热搜词失败')\n\n// after\nif (statusCode != 200 || !body || body.code !== 0) {\n  console.warn('tx hotSearch failed', { statusCode, code: body?.code })\n  if (retryNum < 2) return this.getList(retryNum + 1)\n  throw new Error('获取热搜词失败')\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":"function isTxHotSearchResponse(body) {\n  return body != null && typeof body === 'object' && body.code === 0 && body.hotkey != null && body.hotkey.data != null\n}","tryCatchPattern":"try {\n  const result = await txHotSearch.getList()\n} catch (err) {\n  if (err.message === '获取热搜词失败') {\n    console.warn('QQ Music hot search unavailable')\n    return { source: 'tx', list: [] }\n  }\n  throw err\n}","preventionTips":["Call getList with a retryNum parameter to leverage built-in retries.","Keep the module/method/Referer strings updated by inspecting y.qq.com network traffic.","Fall back to another provider's hot search if QQ Music fails.","Log body.code to detect contract changes or rate-limiting."],"tags":["tencent","qq-music","hot-search","network","api-contract","https","anti-scraping"],"backgroundTag":null,"analyzedSha":"9c364b482e5621a1d38b50e8610d2fb974457e6e","analyzedAt":"2026-08-12T15:14:48.244Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}