Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

js 调用 song_url 无法接受字符串形式的 cookie #812

Closed
chenjunyu19 opened this issue Jun 6, 2020 · 1 comment
Closed

js 调用 song_url 无法接受字符串形式的 cookie #812

chenjunyu19 opened this issue Jun 6, 2020 · 1 comment
Labels

Comments

@chenjunyu19
Copy link

环境

  • 系统/平台: Arch Linux x86_64
  • nodejs 版本: v14.3.0
  • API版本:3.32.2

出现问题

module.exports = (query, request) => {
if(!('MUSIC_U' in query.cookie)) query.cookie._ntes_nuid = crypto.randomBytes(16).toString('hex')

发生异常: TypeError
TypeError: Cannot use 'in' operator to search for 'MUSIC_U' in MUSIC_U=***; Expires=Sun, 21-Jun-2020 11:12:58 GMT; Path=/;__remember_me=true; Expires=Sun, 21-Jun-2020 11:12:58 GMT; Path=/;__csrf=***; Expires=Sun, 21-Jun-2020 11:13:08 GMT; Path=/
    at module.exports (.../NeteaseCloudMusicApi/module/song_url.js:6:18)
    at obj.<computed> (.../NeteaseCloudMusicApi/main.js:10:12)

重现步骤

const { song_url } = require(path.join(ncmApiPath, 'main.js'));
song_url({ id: array.join(','), cookie: 'MUSIC_U=***;......' });

其他

用 js 直接调用的话似乎大部分 api 都需要传入字符串形式的 cookie,而且 login_cellphoneresult.body.cookie 也是字符串形式的。

@Binaryify
Copy link
Owner

已修复

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants