1 Star 2 Fork 18

Sake/NeteaseCloudMusicApi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
generateConfig.js 588 Bytes
一键复制 编辑 原始数据 按行查看 历史
const fs = require('fs')
const path = require('path')
const { register_anonimous } = require('./main')
const { cookieToJson } = require('./util/index')
const tmpPath = require('os').tmpdir()
async function generateConfig() {
try {
const res = await register_anonimous()
const cookie = res.body.cookie
if (cookie) {
const cookieObj = cookieToJson(cookie)
fs.writeFileSync(
path.resolve(tmpPath, 'anonymous_token'),
cookieObj.MUSIC_A,
'utf-8',
)
}
} catch (error) {
console.log(error)
}
}
module.exports = generateConfig
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/Sake809/NeteaseCloudMusicApi.git
git@gitee.com:Sake809/NeteaseCloudMusicApi.git
Sake809
NeteaseCloudMusicApi
NeteaseCloudMusicApi
master

搜索帮助