mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 21:28:06 +00:00
fix: add netease_api
This commit is contained in:
parent
fc0367c9b4
commit
0b701d23da
304 changed files with 27205 additions and 1 deletions
26
netease_api/main.js
Normal file
26
netease_api/main.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const request = require('./util/request')
|
||||
const { cookieToJson } = require('./util/index')
|
||||
|
||||
let obj = {}
|
||||
fs.readdirSync(path.join(__dirname, 'module'))
|
||||
.reverse()
|
||||
.forEach((file) => {
|
||||
if (!file.endsWith('.js')) return
|
||||
let fileModule = require(path.join(__dirname, 'module', file))
|
||||
obj[file.split('.').shift()] = function (data) {
|
||||
if (typeof data.cookie === 'string') {
|
||||
data.cookie = cookieToJson(data.cookie)
|
||||
}
|
||||
return fileModule(
|
||||
{
|
||||
...data,
|
||||
cookie: data.cookie ? data.cookie : {},
|
||||
},
|
||||
request,
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = obj
|
||||
Loading…
Add table
Add a link
Reference in a new issue