mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-22 23:51:23 +08:00
chore(version): 更新api到4.28.0
Co-Authored-By: binaryify <[email protected]>
This commit is contained in:
@@ -2,17 +2,13 @@ const CryptoJS = require('crypto-js')
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const ID_XOR_KEY_1 = '3go8&$8*3*3h0k(2)2'
|
||||
const deviceidText = fs.readFileSync(
|
||||
path.resolve(__dirname, '../data/deviceid.txt'),
|
||||
'utf-8',
|
||||
)
|
||||
|
||||
const createOption = require('../util/option.js')
|
||||
const deviceidList = deviceidText.split('\n')
|
||||
const { generateDeviceId } = require('../util/index')
|
||||
|
||||
function getRandomFromList(list) {
|
||||
return list[Math.floor(Math.random() * list.length)]
|
||||
}
|
||||
// function getRandomFromList(list) {
|
||||
// return list[Math.floor(Math.random() * list.length)]
|
||||
// }
|
||||
function cloudmusic_dll_encode_id(some_id) {
|
||||
let xoredString = ''
|
||||
for (let i = 0; i < some_id.length; i++) {
|
||||
@@ -26,7 +22,8 @@ function cloudmusic_dll_encode_id(some_id) {
|
||||
}
|
||||
|
||||
module.exports = async (query, request) => {
|
||||
const deviceId = getRandomFromList(deviceidList)
|
||||
const deviceId = generateDeviceId()
|
||||
console.log(`[register_anonimous] deviceId: ${deviceId}`)
|
||||
global.deviceId = deviceId
|
||||
const encodedId = CryptoJS.enc.Base64.stringify(
|
||||
CryptoJS.enc.Utf8.parse(
|
||||
|
||||
Reference in New Issue
Block a user